8000 xtensor-python/README.md at 0.26.0 · xtensor-stack/xtensor-python · GitHub
[go: up one dir, main page]

Skip to content
{"payload":{"allShortcutsEnabled":false,"fileTree":{"":{"items":[{"name":".azure-pipelines","path":".azure-pipelines","contentType":"directory"},{"name":"benchmark","path":"benchmark","contentType":"directory"},{"name":"cmake","path":"cmake","contentType":"directory"},{"name":"docs","path":"docs","contentType":"directory"},{"name":"include","path":"include","contentType":"directory"},{"name":"test","path":"test","contentType":"directory"},{"name":"test_python","path":"test_python","contentType":"directory"},{"name":".appveyor.yml","path":".appveyor.yml","contentType":"file"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":"CMakeLists.txt","path":"CMakeLists.txt","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"azure-pipelines.yml","path":"azure-pipelines.yml","contentType":"file"},{"name":"environment-dev.yml","path":"environment-dev.yml","contentType":"file"},{"name":"readthedocs.yml","path":"readthedocs.yml","contentType":"file"},{"name":"xtensor-pythonConfig.cmake.in","path":"xtensor-pythonConfig.cmake.in","contentType":"file"}],"totalCount":16}},"fileTreeProcessingTime":2.910961,"foldersToFetch":[],"incompleteFileTree":false,"repo":{"id":73431892,"defaultBranch":"master","name":"xtensor-python","ownerLogin":"xtensor-stack","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2016-11-11T00:18:30.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/56542697?v=4","public":true,"private":false,"isOrgOwned":true},"codeLineWrapEnabled":false,"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"0.26.0","listCacheKey":"v0:1744619066.0","canEdit":false,"refType":"tag","currentOid":"6544a559ae98953394a1c51d8a637b71882af8da"},"path":"README.md","currentUser":null,"blob":{"rawLines":null,"stylingDirectives":null,"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/xtensor-stack/xtensor-python/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"README.md","displayUrl":"https://github.com/xtensor-stack/xtensor-python/blob/0.26.0/README.md?raw=true","headerInfo":{"blobSize":"7.27 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":null,"isGitLfs":false,"onBranch":false,"shortPath":"2321733","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fxtensor-stack%2Fxtensor-python%2Fblob%2F0.26.0%2FREADME.md","isCSV":false,"isRichtext":true,"toc":[{"level":1,"text":"","anchor":"","htmlText":""},{"level":2,"text":"Installation","anchor":"installation","htmlText":"Installation"},{"level":2,"text":"Documentation","anchor":"documentation","htmlText":"Documentation"},{"level":2,"text":"Usage","anchor":"usage","htmlText":"Usage"},{"level":3,"text":"Example 1: Use an algorithm of the C++ standard library on a numpy array inplace.","anchor":"example-1-use-an-algorithm-of-the-c-standard-library-on-a-numpy-array-inplace","htmlText":"Example 1: Use an algorithm of the C++ standard library on a numpy array inplace."},{"level":3,"text":"Example 2: Create a universal function from a C++ scalar function","anchor":"example-2-create-a-universal-function-from-a-c-scalar-function","htmlText":"Example 2: Create a universal function from a C++ scalar function"},{"level":2,"text":"Installation","anchor":"installation-1","htmlText":"Installation"},{"level":2,"text":"Project cookiecutter","anchor":"project-cookiecutter","htmlText":"Project cookiecutter"},{"level":2,"text":"Building and Running the Tests","anchor":"building-and-running-the-tests","htmlText":"Building and Running the Tests"},{"level":2,"text":"Building the HTML Documentation","anchor":"building-the-html-documentation","htmlText":"Building the HTML Documentation"},{"level":2,"text":"Dependencies on xtensor and pybind11","anchor":"dependencies-on-xtensor-and-pybind11","htmlText":"Dependencies on xtensor and pybind11"},{"level":2,"text":"License","anchor":"license","htmlText":"License"}],"lineInfo":{"truncatedLoc":"229","truncatedSloc":"157"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"Markdown","languageID":222,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/xtensor-stack/xtensor-python/blob/0.26.0/README.md","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/xtensor-stack/xtensor-python/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/xtensor-stack/xtensor-python/raw/refs/tags/0.26.0/README.md","renderImageOrRaw":false,"richText":"\u003carticle class=\"markdown-body entry-content container-lg\" itemprop=\"text\"\u003e\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer\" href=\"/xtensor-stack/xtensor-python/blob/0.26.0/docs/source/xtensor-python.svg\"\u003e\u003cimg src=\"/xtensor-stack/xtensor-python/raw/0.26.0/docs/source/xtensor-python.svg\" alt=\"xtensor-python\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/h1\u003e\u003ca id=\"\" class=\"anchor\" aria-label=\"Permalink: \" href=\"#\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"https://dev.azure.com/xtensor-stack/xtensor-stack/_build/latest?definitionId=7\u0026amp;branchName=master\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/6d41eebdc2adeca71fbca98af23e8aafc6c4f81d476e500d4de007fa0c0bad67/68747470733a2f2f6465762e617a7572652e636f6d2f7874656e736f722d737461636b2f7874656e736f722d737461636b2f5f617069732f6275696c642f7374617475732f7874656e736f722d737461636b2e7874656e736f722d707974686f6e3f6272616e63684e616d653d6d6173746572\" alt=\"Azure Pipelines\" data-canonical-src=\"https://dev.azure.com/xtensor-stack/xtensor-stack/_apis/build/status/xtensor-stack.xtensor-python?branchName=master\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://ci.appveyor.com/project/xtensor-stack/xtensor-python\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/60246ee97979caf6d0f2599f2d033b3d1e45675522d26362224bfe28ed85eb7a/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f346a327964366b386f357862696d71663f7376673d74727565\" alt=\"Appveyor\" data-canonical-src=\"https://ci.appveyor.com/api/projects/status/4j2yd6k8o5xbimqf?svg=true\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://xtensor-python.readthedocs.io/en/latest/?badge=latest\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/f29e97a6e82ee02df63083b6de252f928dc2414ce270535630a06668ff1d1284/687474703a2f2f72656164746865646f63732e6f72672f70726f6a656374732f7874656e736f722d707974686f6e2f62616467652f3f76657273696f6e3d6c6174657374\" alt=\"Documentation\" data-canonical-src=\"http://readthedocs.org/projects/xtensor-python/badge/?version=latest\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://gitter.im/QuantStack/Lobby?utm_source=badge\u0026amp;utm_medium=badge\u0026amp;utm_campaign=pr-badge\u0026amp;utm_content=badge\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/ef3705254e766b5edea93f49291c6d9239f29b942cfdb84f3296d0e37898b067/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667\" alt=\"Join the Gitter Chat\" data-canonical-src=\"https://badges.gitter.im/Join%20Chat.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003ePython bindings for the \u003ca href=\"https://github.com/xtensor-stack/xtensor\"\u003extensor\u003c/a\u003e C++ multi-dimensional array library.\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003extensor\u003c/code\u003e is a C++ library for multi-dimensional arrays enabling numpy-style broadcasting and lazy computing.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003extensor-python\u003c/code\u003e enables inplace use of numpy arrays in C++ with all the benefits from \u003ccode\u003extensor\u003c/code\u003e\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eC++ universal function and broadcasting\u003c/li\u003e\n\u003cli\u003eSTL - compliant APIs.\u003c/li\u003e\n\u003cli\u003eA broad coverage of numpy APIs (see \u003ca href=\"http://xtensor.readthedocs.io/en/latest/numpy.html\" rel=\"nofollow\"\u003ethe numpy to xtensor cheat sheet\u003c/a\u003e).\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003eThe Python bindings for \u003ccode\u003extensor\u003c/code\u003e are based on the \u003ca href=\"https://github.com/pybind/pybind11/\"\u003epybind11\u003c/a\u003e C++ library, which enables seamless interoperability between C++ and Python.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eInstallation\u003c/h2\u003e\u003ca id=\"user-content-installation\" class=\"anchor\" aria-label=\"Permalink: Installation\" href=\"#installation\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003extensor-python\u003c/code\u003e is a header-only library. We provide a package for the mamba (or conda) package manager.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"mamba install -c conda-forge xtensor-python\"\u003e\u003cpre\u003emamba install -c conda-forge xtensor-python\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eDocumentation\u003c/h2\u003e\u003ca id=\"user-content-documentation\" class=\"anchor\" aria-label=\"Permalink: Documentation\" href=\"#documentation\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo get started with using \u003ccode\u003extensor-python\u003c/code\u003e, check out the full documentation\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"http://xtensor-python.readthedocs.io/\" rel=\"nofollow\"\u003ehttp://xtensor-python.readthedocs.io/\u003c/a\u003e\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eUsage\u003c/h2\u003e\u003ca id=\"user-content-usage\" class=\"anchor\" aria-label=\"Permalink: Usage\" href=\"#usage\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003extensor-python offers two container types wrapping numpy arrays inplace to provide an xtensor semantics\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ccode\u003epytensor\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003epyarray\u003c/code\u003e.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003eBoth containers enable the numpy-style APIs of xtensor (see \u003ca href=\"http://xtensor.readthedocs.io/en/latest/numpy.html\" rel=\"nofollow\"\u003ethe numpy to xtensor cheat sheet\u003c/a\u003e).\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eOn the one hand, \u003ccode\u003epyarray\u003c/code\u003e has a dynamic number of dimensions. Just like numpy arrays, it can be reshaped with a shape of a different length (and the new shape is reflected on the python side).\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eOn the other hand \u003ccode\u003epytensor\u003c/code\u003e has a compile time number of dimensions, specified with a template parameter. Shapes of \u003ccode\u003epytensor\u003c/code\u003e instances are stack allocated, making \u003ccode\u003epytensor\u003c/code\u003e a significantly faster expression than \u003ccode\u003epyarray\u003c/code\u003e.\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eExample 1: Use an algorithm of the C++ standard library on a numpy array inplace.\u003c/h3\u003e\u003ca id=\"user-content-example-1-use-an-algorithm-of-the-c-standard-library-on-a-numpy-array-inplace\" class=\"anchor\" aria-label=\"Permalink: Example 1: Use an algorithm of the C++ standard library on a numpy array inplace.\" href=\"#example-1-use-an-algorithm-of-the-c-standard-library-on-a-numpy-array-inplace\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eC++ code\u003c/strong\u003e\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"#include \u0026lt;numeric\u0026gt; // Standard library import for std::accumulate\n#include \u0026lt;pybind11/pybind11.h\u0026gt; // Pybind11 import to define Python bindings\n#include \u0026lt;xtensor/xmath.hpp\u0026gt; // xtensor import for the C++ universal functions\n#define FORCE_IMPORT_ARRAY\n#include \u0026lt;xtensor-python/pyarray.hpp\u0026gt; // Numpy bindings\n\ndouble sum_of_sines(xt::pyarray\u0026lt;double\u0026gt;\u0026amp; m)\n{\n auto sines = xt::sin(m); // sines does not actually hold values.\n return std::accumulate(sines.begin(), sines.end(), 0.0);\n}\n\nPYBIND11_MODULE(xtensor_python_test, m)\n{\n xt::import_numpy();\n m.doc() = \u0026quot;Test module for xtensor python bindings\u0026quot;;\n\n m.def(\u0026quot;sum_of_sines\u0026quot;, sum_of_sines, \u0026quot;Sum the sines of the input values\u0026quot;);\n}\"\u003e\u003cpre\u003e#\u003cspan class=\"pl-k\"\u003einclude\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026lt;\u003c/span\u003enumeric\u003cspan class=\"pl-pds\"\u003e\u0026gt;\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e Standard library import for std::accumulate\u003c/span\u003e\n#\u003cspan class=\"pl-k\"\u003einclude\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026lt;\u003c/span\u003epybind11/pybind11.h\u003cspan class=\"pl-pds\"\u003e\u0026gt;\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e Pybind11 import to define Python bindings\u003c/span\u003e\n#\u003cspan class=\"pl-k\"\u003einclude\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026lt;\u003c/span\u003extensor/xmath.hpp\u003cspan class=\"pl-pds\"\u003e\u0026gt;\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e xtensor import for the C++ universal functions\u003c/span\u003e\n#\u003cspan class=\"pl-k\"\u003edefine\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eFORCE_IMPORT_ARRAY\u003c/span\u003e\n#\u003cspan class=\"pl-k\"\u003einclude\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026lt;\u003c/span\u003extensor-python/pyarray.hpp\u003cspan class=\"pl-pds\"\u003e\u0026gt;\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e Numpy bindings\u003c/span\u003e\n\n\u003cspan class=\"pl-k\"\u003edouble\u003c/span\u003e \u003cspan class=\"pl-en\"\u003esum_of_sines\u003c/span\u003e(xt::pyarray\u0026lt;\u003cspan class=\"pl-k\"\u003edouble\u003c/span\u003e\u0026gt;\u0026amp; m)\n{\n \u003cspan class=\"pl-k\"\u003eauto\u003c/span\u003e sines = \u003cspan class=\"pl-c1\"\u003ext::sin\u003c/span\u003e(m); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e sines does not actually hold values.\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003estd::accumulate\u003c/span\u003e(sines.\u003cspan class=\"pl-c1\"\u003ebegin\u003c/span\u003e(), sines.\u003cspan class=\"pl-c1\"\u003eend\u003c/span\u003e(), \u003cspan class=\"pl-c1\"\u003e0.0\u003c/span\u003e);\n}\n\n\u003cspan class=\"pl-en\"\u003ePYBIND11_MODULE\u003c/span\u003e(xtensor_python_test, m)\n{\n \u003cspan class=\"pl-c1\"\u003ext::import_numpy\u003c/span\u003e();\n m.\u003cspan class=\"pl-c1\"\u003edoc\u003c/span\u003e() = \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eTest module for xtensor python bindings\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e;\n\n m.\u003cspan class=\"pl-c1\"\u003edef\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003esum_of_sines\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, sum_of_sines, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eSum the sines of the input values\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e);\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003ePython Code\u003c/strong\u003e\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-python notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"import numpy as np\nimport xtensor_python_test as xt\n\nv = np.arange(15).reshape(3, 5)\ns = xt.sum_of_sines(v)\nprint(s)\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eimport\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003enumpy\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eas\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003enp\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eimport\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003extensor_python_test\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eas\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ext\u003c/span\u003e\n\n\u003cspan class=\"pl-s1\"\u003ev\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003enp\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003earange\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e15\u003c/span\u003e).\u003cspan class=\"pl-c1\"\u003ereshape\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e3\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e5\u003c/span\u003e)\n\u003cspan class=\"pl-s1\"\u003es\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ext\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003esum_of_sines\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003ev\u003c/span\u003e)\n\u003cspan class=\"pl-en\"\u003eprint\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003es\u003c/span\u003e)\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eOutputs\u003c/strong\u003e\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"1.2853996391883833\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003e1.2853996391883833\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eWorking example\u003c/strong\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eGet the working example here:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"/xtensor-stack/xtensor-python/blob/0.26.0/docs/source/examples/readme_example_1/CMakeLists.txt\"\u003e\u003ccode\u003eCMakeLists.txt\u003c/code\u003e\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"/xtensor-stack/xtensor-python/blob/0.26.0/docs/source/examples/readme_example_1/main.cpp\"\u003e\u003ccode\u003emain.cpp\u003c/code\u003e\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"/xtensor-stack/xtensor-python/blob/0.26.0/docs/source/examples/readme_example_1/example.py\"\u003e\u003ccode\u003eexample.py\u003c/code\u003e\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eExample 2: Create a universal function from a C++ scalar function\u003c/h3\u003e\u003ca id=\"user-content-example-2-create-a-universal-function-from-a-c-scalar-function\" class=\"anchor\" aria-label=\"Permalink: Example 2: Create a universal function from a C++ scalar function\" href=\"#example-2-create-a-universal-function-from-a-c-scalar-function\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eC++ code\u003c/strong\u003e\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"#include \u0026lt;pybind11/pybind11.h\u0026gt;\n#define FORCE_IMPORT_ARRAY\n#include \u0026lt;xtensor-python/pyvectorize.hpp\u0026gt;\n#include \u0026lt;numeric\u0026gt;\n#include \u0026lt;cmath\u0026gt;\n\nnamespace py = pybind11;\n\ndouble scalar_func(double i, double j)\n{\n return std::sin(i) - std::cos(j);\n}\n\nPYBIND11_MODULE(xtensor_python_test, m)\n{\n xt::import_numpy();\n m.doc() = \u0026quot;Test module for xtensor python bindings\u0026quot;;\n\n m.def(\u0026quot;vectorized_func\u0026quot;, xt::pyvectorize(scalar_func), \u0026quot;\u0026quot;);\n}\"\u003e\u003cpre\u003e#\u003cspan class=\"pl-k\"\u003einclude\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026lt;\u003c/span\u003epybind11/pybind11.h\u003cspan class=\"pl-pds\"\u003e\u0026gt;\u003c/span\u003e\u003c/span\u003e\n#\u003cspan class=\"pl-k\"\u003edefine\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eFORCE_IMPORT_ARRAY\u003c/span\u003e\n#\u003cspan class=\"pl-k\"\u003einclude\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026lt;\u003c/span\u003extensor-python/pyvectorize.hpp\u003cspan class=\"pl-pds\"\u003e\u0026gt;\u003c/span\u003e\u003c/span\u003e\n#\u003cspan class=\"pl-k\"\u003einclude\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026lt;\u003c/span\u003enumeric\u003cspan class=\"pl-pds\"\u003e\u0026gt;\u003c/span\u003e\u003c/span\u003e\n#\u003cspan class=\"pl-k\"\u003einclude\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026lt;\u003c/span\u003ecmath\u003cspan class=\"pl-pds\"\u003e\u0026gt;\u003c/span\u003e\u003c/span\u003e\n\n\u003cspan class=\"pl-k\"\u003enamespace\u003c/span\u003e \u003cspan class=\"pl-en\"\u003epy\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e pybind11;\n\n\u003cspan class=\"pl-k\"\u003edouble\u003c/span\u003e \u003cspan class=\"pl-en\"\u003escalar_func\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003edouble\u003c/span\u003e i, \u003cspan class=\"pl-k\"\u003edouble\u003c/span\u003e j)\n{\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003estd::sin\u003c/span\u003e(i) - \u003cspan class=\"pl-c1\"\u003estd::cos\u003c/span\u003e(j);\n}\n\n\u003cspan class=\"pl-en\"\u003ePYBIND11_MODULE\u003c/span\u003e(xtensor_python_test, m)\n{\n \u003cspan class=\"pl-c1\"\u003ext::import_numpy\u003c/span\u003e();\n m.\u003cspan class=\"pl-c1\"\u003edoc\u003c/span\u003e() = \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eTest module for xtensor python bindings\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e;\n\n m.\u003cspan class=\"pl-c1\"\u003edef\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003evectorized_func\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003ext::pyvectorize\u003c/span\u003e(scalar_func), \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e);\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003ePython Code\u003c/strong\u003e\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-python notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"import numpy as np\nimport xtensor_python_test as xt\n\nx = np.arange(15).reshape(3, 5)\ny = [1, 2, 3, 4, 5]\nz = xt.vectorized_func(x, y)\nprint(z)\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eimport\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003enumpy\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eas\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003enp\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eimport\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003extensor_python_test\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eas\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ext\u003c/span\u003e\n\n\u003cspan class=\"pl-s1\"\u003ex\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003enp\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003earange\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e15\u003c/span\u003e).\u003cspan class=\"pl-c1\"\u003ereshape\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e3\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e5\u003c/span\u003e)\n\u003cspan class=\"pl-s1\"\u003ey\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e [\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e3\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e4\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e5\u003c/span\u003e]\n\u003cspan class=\"pl-s1\"\u003ez\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003ext\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003evectorized_func\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003ex\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003ey\u003c/span\u003e)\n\u003cspan class=\"pl-en\"\u003eprint\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003ez\u003c/span\u003e)\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eOutputs\u003c/strong\u003e\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"[[-0.540302, 1.257618, 1.89929 , 0.794764, -1.040465],\n [-1.499227, 0.136731, 1.646979, 1.643002, 0.128456],\n [-1.084323, -0.583843, 0.45342 , 1.073811, 0.706945]]\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003e[[-0.540302, 1.257618, 1.89929 , 0.794764, -1.040465],\n [-1.499227, 0.136731, 1.646979, 1.643002, 0.128456],\n [-1.084323, -0.583843, 0.45342 , 1.073811, 0.706945]]\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eInstallation\u003c/h2\u003e\u003ca id=\"user-content-installation-1\" class=\"anchor\" aria-label=\"Permalink: Installation\" href=\"#installation-1\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eWe provide a package for the conda package manager.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"conda install -c conda-forge xtensor-python\"\u003e\u003cpre\u003econda install -c co 5D4F nda-forge xtensor-python\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis will pull the dependencies to xtensor-python, that is \u003ccode\u003epybind11\u003c/code\u003e and \u003ccode\u003extensor\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eProject cookiecutter\u003c/h2\u003e\u003ca id=\"user-content-project-cookiecutter\" class=\"anchor\" aria-label=\"Permalink: Project cookiecutter\" href=\"#project-cookiecutter\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eA template for a project making use of \u003ccode\u003extensor-python\u003c/code\u003e is available in the form of a cookiecutter \u003ca href=\"https://github.com/xtensor-stack/xtensor-python-cookiecutter\"\u003ehere\u003c/a\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThis project is meant to help library authors get started with the xtensor python bindings.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIt produces a project following the best practices for the packaging and distribution of Python extensions based on \u003ccode\u003extensor-python\u003c/code\u003e, including a \u003ccode\u003esetup.py\u003c/code\u003e file and a conda recipe.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eBuilding and Running the Tests\u003c/h2\u003e\u003ca id=\"user-content-building-and-running-the-tests\" class=\"anchor\" aria-label=\"Permalink: Building and Running the Tests\" href=\"#building-and-running-the-tests\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTesting \u003ccode\u003extensor-python\u003c/code\u003e requires \u003ccode\u003epytest\u003c/code\u003e\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"py.test .\"\u003e\u003cpre\u003epy.test \u003cspan class=\"pl-c1\"\u003e.\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo pick up changes in \u003ccode\u003extensor-python\u003c/code\u003e while rebuilding, delete the \u003ccode\u003ebuild/\u003c/code\u003e directory.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eBuilding the HTML Documentation\u003c/h2\u003e\u003ca id=\"user-content-building-the-html-documentation\" class=\"anchor\" aria-label=\"Permalink: Building the HTML Documentation\" href=\"#building-the-html-documentation\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003extensor-python\u003c/code\u003e's documentation is built with three tools\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"http://www.doxygen.org\" rel=\"nofollow\"\u003edoxygen\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"http://www.sphinx-doc.org\" rel=\"nofollow\"\u003esphinx\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://breathe.readthedocs.io\" rel=\"nofollow\"\u003ebreathe\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003eWhile doxygen must be installed separately, you can install breathe by typing\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"pip install breathe\"\u003e\u003cpre\u003epip install breathe\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eBreathe can also be installed with \u003ccode\u003econda\u003c/code\u003e\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"conda install -c conda-forge breathe\"\u003e\u003cpre\u003econda install -c conda-forge breathe\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eFinally, build the documentation with\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"make html\"\u003e\u003cpre\u003emake html\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003efrom the \u003ccode\u003edocs\u003c/code\u003e subdirectory.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eDependencies on \u003ccode\u003extensor\u003c/code\u003e and \u003ccode\u003epybind11\u003c/code\u003e\u003c/h2\u003e\u003ca id=\"user-content-dependencies-on-xtensor-and-pybind11\" class=\"anchor\" aria-label=\"Permalink: Dependencies on xtensor and pybind11\" href=\"#dependencies-on-xtensor-and-pybind11\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003extensor-python\u003c/code\u003e depends on the \u003ccode\u003extensor\u003c/code\u003e and \u003ccode\u003epybind11\u003c/code\u003e libraries\u003c/p\u003e\n\u003cmarkdown-accessiblity-table\u003e\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003e\u003ccode\u003extensor-python\u003c/code\u003e\u003c/th\u003e\n\u003cth\u003e\u003ccode\u003extensor\u003c/code\u003e\u003c/th\u003e\n\u003cth\u003e\u003ccode\u003epybind11\u003c/code\u003e\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003emaster\u003c/td\u003e\n\u003ctd\u003e^0.24.0\u003c/td\u003e\n\u003ctd\u003e~2.4.3\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e0.26.0\u003c/td\u003e\n\u003ctd\u003e^0.24.0\u003c/td\u003e\n\u003ctd\u003e~2.4.3\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e0.25.3\u003c/td\u003e\n\u003ctd\u003e^0.23.0\u003c/td\u003e\n\u003ctd\u003e~2.4.3\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e0.25.2\u003c/td\u003e\n\u003ctd\u003e^0.23.0\u003c/td\u003e\n\u003ctd\u003e~2.4.3\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e0.25.1\u003c/td\u003e\n\u003ctd\u003e^0.23.0\u003c/td\u003e\n\u003ctd\u003e~2.4.3\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e0.25.0\u003c/td\u003e\n\u003ctd\u003e^0.23.0\u003c/td\u003e\n\u003ctd\u003e~2.4.3\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e0.24.1\u003c/td\u003e\n\u003ctd\u003e^0.21.2\u003c/td\u003e\n\u003ctd\u003e~2.4.3\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e0.24.0\u003c/td\u003e\n\u003ctd\u003e^0.21.1\u003c/td\u003e\n\u003ctd\u003e~2.4.3\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e0.23.2\u003c/td\u003e\n\u003ctd\u003e^0.20.10\u003c/td\u003e\n\u003ctd\u003e~2.4.3\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e0.23.1\u003c/td\u003e\n\u003ctd\u003e^0.20.6\u003c/td\u003e\n\u003ctd\u003e~2.2.1\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e0.23.0\u003c/td\u003e\n\u003ctd\u003e^0.20.4\u003c/td\u003e\n\u003ctd\u003e~2.2.1\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e0.22.x\u003c/td\u003e\n\u003ctd\u003e^0.19.0\u003c/td\u003e\n\u003ctd\u003e~2.2.1\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e0.21.x\u003c/td\u003e\n\u003ctd\u003e^0.18.0\u003c/td\u003e\n\u003ctd\u003e~2.2.1\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e0.20.x\u003c/td\u003e\n\u003ctd\u003e^0.17.0\u003c/td\u003e\n\u003ctd\u003e~2.2.1\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e0.19.x\u003c/td\u003e\n\u003ctd\u003e^0.16.0\u003c/td\u003e\n\u003ctd\u003e~2.2.1\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\u003c/markdown-accessiblity-table\u003e\n\u003cp dir=\"auto\"\u003eThese dependencies are automatically resolved when using the conda package manager.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eLicense\u003c/h2\u003e\u003ca id=\"user-content-license\" class=\"anchor\" aria-label=\"Permalink: License\" href=\"#license\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eWe use a shared copyright model that enables all contributors to maintain the\ncopyright on their contributions.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThis software is licensed under the BSD-3-Clause license. See the \u003ca href=\"/xtensor-stack/xtensor-python/blob/0.26.0/LICENSE\"\u003eLICENSE\u003c/a\u003e file for details.\u003c/p\u003e\n\u003c/article\u003e","renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":null},"copilotInfo":null,"copilotAccessAllowed":false,"modelsAccessAllowed":false,"modelsRepoIntegrationEnabled":false,"isMarketplaceEnabled":true,"csrf_tokens":{"/xtensor-stack/xtensor-python/branches":{"post":"s1cMD9MNym8wgtxJLrCU8vusZJPsalKAeFCmvik9z5UUzmMu-oYoHY56qP_JYhPLs_RmUeJOmiQjiJ56yWOE_w"},"/repos/preferences":{"post":"LKR9cAIOv75a_zRAEyvbU77erv51iL4r0YuxPppzx9IJUIDZl6QW3YFrbu1HSje_Vpg-xeFtpJz8y7okyeoGSw"}}},"title":"xtensor-python/README.md at 0.26.0 · xtensor-stack/xtensor-python","appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-263cab1760dd.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-98e6e9db3609.js","githubDevUrl":null,"enabled_features":{"code_nav_ui_events":false,"react_blob_overlay":false,"accessible_code_button":true}}}
0