{ "info": { "author": "Cambridge University Spaceflight", "author_email": "contact@cusf.co.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Programming Language :: Python :: 3.3" ], "description": "A helper / hack to allow us to cast a ``mmap.mmap`` or other buffer to\na Cython pointer of the correct type.\n\nCython is capable of casting a lot of things to a C pointer of the\ncorrect type, especially with the aid of ``memoryview``. However,\nin Python 2, ``memoryview`` lacks the ``memoryview.cast`` method\n(so Cython won't let us change the dimensions of the array). Further,\nboth Python 2 and 3 require the memory map to be writable (making\nthe pointer type ``const`` does not seem to help here either).\n\nThis class takes a (possibly read-only) memmap object, and produces a\nPython object with a ``__getbuffer__`` method that returns The Right Thing.\n*It pretends that the underlying buffer is writable* to make Cython\nhappy. If you give it a read-only buffer, and try to write to the result,\nthen you will have a bad time.\n\nWhen a Python object is cast by Cython to a pointer, it holds a\nreference to the underlying Python object in order to prevent the\nmemory to which it refers being garbage collected. The ``MagicMemoryView``\nin turn keeps a reference to the underlying data, so everything should\nbehave as expected.\n\nUsage::\n\n from magicmemoryview import MagicMemoryView\n\n cdef double data[:, :, :]\n\n data = MagicMemoryView(source_buffer, (24, 12, 25), \"d\")", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/cuspaceflight/magicmemoryview", "keywords": null, "license": "GPLv3+", "maintainer": null, "maintainer_email": null, "name": "magicmemoryview", "package_url": "https://pypi.org/project/magicmemoryview/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/magicmemoryview/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/cuspaceflight/magicmemoryview" }, "release_url": "https://pypi.org/project/magicmemoryview/0.1.5/", "requires_dist": null, "requires_python": null, "summary": "Magic memoryview() style casting for Cython", "version": "0.1.5" }, "last_serial": 1185553, "releases": { "0.1.5": [ { "comment_text": "", "digests": { "md5": "c072df5c561228abd3eb39937e37f09d", "sha256": "d1001a6fa084175ef65801f2133fac577a2a472bf8456e174dd328293dcf386b" }, "downloads": -1, "filename": "magicmemoryview-0.1.5.tar.gz", "has_sig": false, "md5_digest": "c072df5c561228abd3eb39937e37f09d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23484, "upload_time": "2014-08-10T12:22:57", "url": "https://files.pythonhosted.org/packages/57/89/a174c3abaf1da91cedfca8dda9dddcac25d429cefcbc290ebcd7b88edb84/magicmemoryview-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c072df5c561228abd3eb39937e37f09d", "sha256": "d1001a6fa084175ef65801f2133fac577a2a472bf8456e174dd328293dcf386b" }, "downloads": -1, "filename": "magicmemoryview-0.1.5.tar.gz", "has_sig": false, "md5_digest": "c072df5c561228abd3eb39937e37f09d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23484, "upload_time": "2014-08-10T12:22:57", "url": "https://files.pythonhosted.org/packages/57/89/a174c3abaf1da91cedfca8dda9dddcac25d429cefcbc290ebcd7b88edb84/magicmemoryview-0.1.5.tar.gz" } ] }