├── .gitignore ├── {{cookiecutter.github_project_name}} ├── .gitignore ├── docs │ ├── {{ cookiecutter.python_package_name }}.rst │ ├── index.rst │ ├── make.bat │ ├── Makefile │ └── conf.py ├── RELEASE.md ├── tests │ └── test_extension.py ├── src │ └── main.cpp ├── README.md ├── cmake │ └── FindNumPy.cmake ├── setup.py └── Test_Run.ipynb ├── cookiecutter.json ├── LICENSE ├── .appveyor.yml ├── README.md └── .travis.yml /.gitignore: -------------------------------------------------------------------------------- 1 | *.egg-info/ 2 | .ipynb_checkpoints/ 3 | dist/ 4 | build/ 5 | *.py[cod] 6 | 7 | # OS X 8 | .DS_Store 9 | -------------------------------------------------------------------------------- /{{cookiecutter.github_project_name}}/.gitignore: -------------------------------------------------------------------------------- 1 | *.egg-info/ 2 | .ipynb_checkpoints/ 3 | dist/ 4 | build/ 5 | *.py[cod] 6 | 7 | # OS X 8 | .DS_Store 9 | -------------------------------------------------------------------------------- /{{cookiecutter.github_project_name}}/docs/{{ cookiecutter.python_package_name }}.rst: -------------------------------------------------------------------------------- 1 | {{ cookiecutter.python_package_name }} 2 | ========================= 3 | 4 | .. automodule:: {{ cookiecutter.python_package_name }} 5 | -------------------------------------------------------------------------------- /{{cookiecutter.github_project_name}}/docs/index.rst: -------------------------------------------------------------------------------- 1 | {{ cookiecutter.python_package_name }} Documentation 2 | ======================================= 3 | 4 | Contents: 5 | 6 | .. toctree:: 7 | :maxdepth: 1 8 | 9 | {{ cookiecutter.python_package_name }} 10 | 11 | -------------------------------------------------------------------------------- /cookiecutter.json: -------------------------------------------------------------------------------- 1 | { 2 | "author_name": "", 3 | "author_email": "", 4 | "github_project_name": "xtensor-example-extension", 5 | "github_organization_name": "xtensor-stack", 6 | "python_package_name": "xtensor_example_extension", 7 | "cpp_namespace": "ext", 8 | "project_short_description": "An example xtensor extension" 9 | } 10 | -------------------------------------------------------------------------------- /{{cookiecutter.github_project_name}}/RELEASE.md: -------------------------------------------------------------------------------- 1 | - To release a new version of {{ cookiecutter.python_package_name }} on PyPI: 2 | 3 | Update the version number in setup.py (set release version, remove 'dev') 4 | git add and git commit 5 | python setup.py sdist upload && python setup.py bdist_wheel upload 6 | git tag -a X.X.X -m 'comment' 7 | Update the version number in setup.py (add 'dev' and increment minor) 8 | git add and git commit 9 | git push 10 | git push --tags 11 | -------------------------------------------------------------------------------- /{{cookiecutter.github_project_name}}/tests/test_extension.py: -------------------------------------------------------------------------------- 1 | import {{ cookiecutter.python_package_name }} as m 2 | from unittest import TestCase 3 | import numpy as np 4 | 5 | 6 | class ExampleTest(TestCase): 7 | 8 | def test_example1(self): 9 | self.assertEqual(4, m.example1([4, 5, 6])) 10 | 11 | def test_example2(self): 12 | x = np.array([[0., 1.], [2., 3.]]) 13 | res = np.array([[2., 3.], [4., 5.]]) 14 | y = m.example2(x) 15 | np.testing.assert_allclose(y, res, 1e-12) 16 | 17 | def test_vectorize(self): 18 | x1 = np.array([[0, 1], [2, 3]]) 19 | x2 = np.array([0, 1]) 20 | res = np.array([[ 1. , 1.381773290676036], 21 | [ 1.909297426825682, 0.681422313928007]]) 22 | y = m.vectorize_example1(x1, x2) 23 | np.testing.assert_allclose(y, res, 1e-12) 24 | 25 | def test_readme_example1(self): 26 | v = np.arange(15).reshape(3, 5) 27 | y = m.readme_example1(v) 28 | np.testing.assert_allclose(y, 1.2853996391883833, 1e-12) 29 | 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Johan Mabille and Sylvain Corlay 2 | Copyright (c) 2016, QuantStack 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | * Neither the name of the copyright holder nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /.appveyor.yml: -------------------------------------------------------------------------------- 1 | build: false 2 | 3 | os: Visual Studio 2015 4 | 5 | platform: 6 | - x64 7 | 8 | environment: 9 | matrix: 10 | - MINICONDA: C:\xtensor-conda 11 | 12 | init: 13 | - "ECHO %MINICONDA%" 14 | - C:\"Program Files (x86)"\"Microsoft Visual Studio 14.0"\VC\vcvarsall.bat %PLATFORM% 15 | - ps: if($env:Platform -eq "x64"){Start-FileDownload 'http://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe' C:\Miniconda.exe; echo "Done"} 16 | - ps: if($env:Platform -eq "x86"){Start-FileDownload 'http://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86.exe' C:\Miniconda.exe; echo "Done"} 17 | - cmd: C:\Miniconda.exe /S /D=C:\xtensor-conda 18 | - "set PATH=%MINICONDA%;%MINICONDA%\\Scripts;%MINICONDA%\\Library\\bin;%PATH%" 19 | 20 | install: 21 | - conda config --set always_yes yes --set changeps1 no 22 | - conda update -q conda 23 | - conda info -a 24 | - "set PYTHONHOME=%MINICONDA%" 25 | # Install xtensor-python 26 | - conda install xtensor-python=0.23.0 -c conda-forge 27 | # Install cookiecutter and pytest 28 | - conda install pytest cookiecutter -c conda-forge 29 | # Run cookiecutter in build directory 30 | - mkdir build 31 | - cd build 32 | - cookiecutter %APPVEYOR_BUILD_FOLDER% --no-input 33 | # Defaults to 34 | # "author_name": "", 35 | # "author_email": "", 36 | # "github_project_name": "xtensor-example-extension", 37 | # "github_organization_name": "xtensor-stack", 38 | # "python_package_name": "xtensor_example_extension", 39 | # "cpp_namespace": "ext", 40 | # "project_short_description": "An example xtensor extension" 41 | - pip install .\\xtensor-example-extension 42 | 43 | build_script: 44 | - py.test -s 45 | -------------------------------------------------------------------------------- /{{cookiecutter.github_project_name}}/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "pybind11/pybind11.h" 2 | 3 | #include "xtensor/xmath.hpp" 4 | #include "xtensor/xarray.hpp" 5 | 6 | #define FORCE_IMPORT_ARRAY 7 | #include "xtensor-python/pyarray.hpp" 8 | #include "xtensor-python/pyvectorize.hpp" 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | namespace py = pybind11; 15 | 16 | // Examples 17 | 18 | inline double example1(xt::pyarray &m) 19 | { 20 | return m(0); 21 | } 22 | 23 | inline xt::pyarray example2(xt::pyarray &m) 24 | { 25 | return m + 2; 26 | } 27 | 28 | // Readme Examples 29 | 30 | inline double readme_example1(xt::pyarray &m) 31 | { 32 | auto sines = xt::sin(m); 33 | return std::accumulate(sines.cbegin(), sines.cend(), 0.0); 34 | } 35 | 36 | // Vectorize Examples 37 | 38 | inline double scalar_func(double i, double j) 39 | { 40 | return std::sin(i) + std::cos(j); 41 | } 42 | 43 | // Python Module and Docstrings 44 | 45 | PYBIND11_MODULE({{ cookiecutter.python_package_name }}, m) 46 | { 47 | xt::import_numpy(); 48 | 49 | m.doc() = R"pbdoc( 50 | {{ cookiecutter.project_short_description }} 51 | 52 | .. currentmodule:: {{ cookiecutter.python_package_name }} 53 | 54 | .. autosummary:: 55 | :toctree: _generate 56 | 57 | example1 58 | example2 59 | readme_example1 60 | vectorize_example1 61 | )pbdoc"; 62 | 63 | m.def("example1", example1, "Return the first element of an array, of dimension at least one"); 64 | m.def("example2", example2, "Return the the specified array plus 2"); 65 | 66 | m.def("readme_example1", readme_example1, "Accumulate the sines of all the values of the specified array"); 67 | 68 | m.def("vectorize_example1", xt::pyvectorize(scalar_func), "Add the sine and and cosine of the two specified values"); 69 | } 70 | -------------------------------------------------------------------------------- /{{cookiecutter.github_project_name}}/README.md: -------------------------------------------------------------------------------- 1 | {{ cookiecutter.github_project_name }} 2 | ============== 3 | 4 | {{ cookiecutter.project_short_description }} 5 | 6 | 7 | Installation 8 | ------------ 9 | 10 | **On Unix (Linux, OS X)** 11 | 12 | - clone this repository 13 | - `pip install ./{{ cookiecutter.github_project_name }}` 14 | 15 | **On Windows (Requires Visual Studio 2015)** 16 | 17 | - For Python 3.5: 18 | - clone this repository 19 | - `pip install ./{{ cookiecutter.github_project_name }}` 20 | - For earlier versions of Python, including Python 2.7: 21 | 22 | xtensor requires a C++14 compliant compiler (i.e. Visual Studio 2015 on 23 | Windows). Running a regular `pip install` command will detect the version 24 | of the compiler used to build Python and attempt to build the extension 25 | with it. We must force the use of Visual Studio 2015. 26 | 27 | - clone this repository 28 | - `"%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" x64` 29 | - `set DISTUTILS_USE_SDK=1` 30 | - `set MSSdk=1` 31 | - `pip install ./{{ cookiecutter.github_project_name }}` 32 | 33 | Note that this requires the user building `{{ cookiecutter.github_project_name }}` to have registry edition 34 | rights on the machine, to be able to run the `vcvarsall.bat` script. 35 | 36 | 37 | Windows runtime requirements 38 | ---------------------------- 39 | 40 | On Windows, the Visual C++ 2015 redistributable packages are a runtime 41 | requirement for this project. It can be found [here](https://www.microsoft.com/en-us/download/details.aspx?id=48145). 42 | 43 | If you use the Anaconda python distribution, you may require the Visual Studio 44 | runtime as a platform-dependent runtime requirement for you package: 45 | 46 | ```yaml 47 | requirements: 48 | build: 49 | - python 50 | - setuptools 51 | - pybind11 52 | 53 | run: 54 | - python 55 | - vs2015_runtime # [win] 56 | ``` 57 | 58 | 59 | Building the documentation 60 | -------------------------- 61 | 62 | Documentation for the example project is generated using Sphinx. Sphinx has the 63 | ability to automatically inspect the signatures and documentation strings in 64 | the extension module to generate beautiful documentation in a variety formats. 65 | The following command generates HTML-based reference documentation; for other 66 | formats please refer to the Sphinx manual: 67 | 68 | - `{{ cookiecutter.github_project_name }}/docs` 69 | - `make html` 70 | 71 | 72 | Running the tests 73 | ----------------- 74 | 75 | Running the tests requires `pytest`. 76 | 77 | ```bash 78 | py.test . 79 | ``` 80 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ![xtensor-cookiecutter](xtensor-cookiecutter.svg) 2 | 3 | [![Travis](https://travis-ci.org/xtensor-stack/xtensor-python-cookiecutter.svg?branch=master)](https://travis-ci.org/xtensor-stack/xtensor-python-cookiecutter) 4 | [![Appveyor](https://ci.appveyor.com/api/projects/status/jpplisnhk808l8c8?svg=true)](https://ci.appveyor.com/project/xtensor-stack/xtensor-python-cookiecutter) 5 | [![Documentation Status](https://readthedocs.org/projects/xtensor/badge/?version=latest)](https://xtensor.readthedocs.io/en/latest/?badge=latest) 6 | [![Join the Gitter Chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/QuantStack/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 7 | 8 | #### A [cookiecutter](https://github.com/audreyr/cookiecutter) template for creating a custom Python extension with xtensor 9 | 10 | ## What is xtensor-python-cookiecutter? 11 | 12 | `xtensor-python-cookiecutter` helps extension authors create Python extension modules making use of xtensor. 13 | 14 | It takes care of the initial work of generating a project skeleton with 15 | 16 | - A complete `setup.py` compiling the extension module 17 | - A few examples included in the resulting project including 18 | 19 | - A universal function defined from C++ 20 | - A function making use of an algorithm from the STL on a numpy array 21 | - Unit tests 22 | - The generation of the HTML documentation with sphinx 23 | 24 | ## Usage 25 | 26 | Install [cookiecutter](https://github.com/audreyr/cookiecutter): 27 | 28 | $ pip install cookiecutter 29 | 30 | After installing cookiecutter, use the xtensor-python-cookiecutter: 31 | 32 | $ cookiecutter https://github.com/xtensor-stack/xtensor-python-cookiecutter.git 33 | 34 | As xtensor-python-cookiecutter runs, you will be asked for basic information about 35 | your custom extension project. You will be prompted for the following 36 | information: 37 | 38 | - `author_name`: your name or the name of your organization, 39 | - `author_email`: your project's contact email, 40 | - `github_project_name`: name of the GitHub repository for your project, 41 | - `github_organization_name`: name of the GithHub organization for your project, 42 | - `python_package_name`: name of the Python package created by your extension, 43 | - `cpp_namespace`: name for the cpp namespace holding the implementation of your extension, 44 | - `project_short_description`: a short description for your project. 45 | 46 | This will produce a directory containing all the required content for a minimal extension 47 | project making use of xtensor with all the required boilerplate for package management, 48 | together with a few basic examples. The generated Python extension requires an installation 49 | of `xtensor` `^0.18.0`, `xtensor-python` `^0.21.0`, `numpy`, and `pybind11` `^2.1.0`. 50 | 51 | Install the module: 52 | 53 | $ pip install ./{{ cookiecutter.github_project_name }}/ 54 | 55 | 56 | If you have [Jupyter](jupyter.org) installed, run the [Test_Run notebook](http://nbviewer.jupyter.org/github/xtensor-stack/xtensor-python-cookiecutter/blob/master/Test_Run.ipynb): 57 | 58 | $ cd {{ cookiecutter.github_project_name }} 59 | $ jupyter notebook 60 | 61 | ## Resources 62 | 63 | - [Documentation of xtensor](https://xtensor.readthedocs.io/en/latest/) 64 | - [Documentation of xtensor-python](https://xtensor-pyhton.readthedocs.io/en/latest/) 65 | - [Documentation of xtensor-julia](https://xtensor-julia.readthedocs.io/en/latest/) 66 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | dist: precise 3 | matrix: 4 | include: 5 | - os: linux 6 | addons: 7 | apt: 8 | sources: 9 | - ubuntu-toolchain-r-test 10 | packages: 11 | - g++-4.9 12 | env: COMPILER=gcc GCC=4.9 PY=3 13 | - os: linux 14 | addons: 15 | apt: 16 | sources: 17 | - ubuntu-toolchain-r-test 18 | packages: 19 | - g++-5 20 | env: COMPILER=gcc GCC=5 PY=3 21 | - os: linux 22 | addons: 23 | apt: 24 | sources: 25 | - ubuntu-toolchain-r-test 26 | packages: 27 | - g++-5 28 | env: COMPILER=gcc GCC=5 PY=2 29 | - os: linux 30 | addons: 31 | apt: 32 | sources: 33 | - ubuntu-toolchain-r-test 34 | - llvm-toolchain-precise-3.6 35 | packages: 36 | - clang-3.6 37 | env: COMPILER=clang CLANG=3.6 PY=3 38 | - os: linux 39 | addons: 40 | apt: 41 | sources: 42 | - ubuntu-toolchain-r-test 43 | - llvm-toolchain-precise-3.7 44 | packages: 45 | - clang-3.7 46 | env: COMPILER=clang CLANG=3.7 PY=3 47 | - os: osx 48 | osx_image: xcode8 49 | compiler: clang 50 | env: PY=3 51 | env: 52 | global: 53 | - MINCONDA_VERSION="latest" 54 | - MINCONDA_LINUX="Linux-x86_64" 55 | - MINCONDA_OSX="MacOSX-x86_64" 56 | before_install: 57 | - | 58 | # Configure build variables 59 | if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then 60 | if [[ "$COMPILER" == "gcc" ]]; then 61 | export CXX=g++-$GCC CC=gcc-$GCC; 62 | fi 63 | if [[ "$COMPILER" == "clang" ]]; then 64 | export CXX=clang++-$CLANG CC=clang-$CLANG; 65 | fi 66 | elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then 67 | export CXX=clang++ CC=clang PYTHONHOME=$HOME/miniconda; 68 | fi 69 | 70 | install: 71 | # Download and update miniconda 72 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then 73 | MINCONDA_OS=$MINCONDA_LINUX; 74 | elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then 75 | MINCONDA_OS=$MINCONDA_OSX; 76 | fi 77 | - if [[ "$PY" == "3" ]]; then 78 | wget "http://repo.continuum.io/miniconda/Miniconda3-$MINCONDA_VERSION-$MINCONDA_OS.sh" -O miniconda.sh; 79 | else 80 | wget "http://repo.continuum.io/miniconda/Miniconda2-$MINCONDA_VERSION-$MINCONDA_OS.sh" -O miniconda.sh; 81 | fi 82 | - bash miniconda.sh -b -p $HOME/miniconda 83 | - export PATH="$HOME/miniconda/bin:$PATH" 84 | - hash -r 85 | - conda config --set always_yes yes --set changeps1 no 86 | - conda clean --packages 87 | # The 2 following lines are a workaround to https://github.com/conda/conda/issues/9337 88 | - pip uninstall -y setuptools 89 | - conda install setuptools 90 | - conda update -q conda 91 | - conda info -a 92 | # Install xtensor-python 93 | - conda install xtensor-python=0.23.0 -c conda-forge 94 | # Install cookiecutter and pytest 95 | - conda install pytest cookiecutter -c conda-forge 96 | # Run cookiecutter in build directory 97 | - mkdir build 98 | - cd build 99 | - cookiecutter $TRAVIS_BUILD_DIR --no-input 100 | # Defaults to 101 | # "author_name": "", 102 | # "author_email": "", 103 | # "github_project_name": "xtensor-example-extension", 104 | # "github_organization_name": "xtensor-stack", 105 | # "python_package_name": "xtensor_example_extension", 106 | # "cpp_namespace": "ext", 107 | # "project_short_description": "An example xtensor extension" 108 | - pip install ./xtensor-example-extension 109 | 110 | script: 111 | - py.test -s 112 | 113 | -------------------------------------------------------------------------------- /{{cookiecutter.github_project_name}}/cmake/FindNumPy.cmake: -------------------------------------------------------------------------------- 1 | # - Find the NumPy libraries 2 | # This module finds if NumPy is installed, and sets the following variables 3 | # indicating where it is. 4 | # 5 | # TODO: Update to provide the libraries and paths for linking npymath lib. 6 | # 7 | # NUMPY_FOUND - was NumPy found 8 | # NUMPY_VERSION - the version of NumPy found as a string 9 | # NUMPY_VERSION_MAJOR - the major version number of NumPy 10 | # NUMPY_VERSION_MINOR - the minor version number of NumPy 11 | # NUMPY_VERSION_PATCH - the patch version number of NumPy 12 | # NUMPY_VERSION_DECIMAL - e.g. version 1.6.1 is 10601 13 | # NUMPY_INCLUDE_DIRS - path to the NumPy include files 14 | 15 | #============================================================================ 16 | # Copyright 2012 Continuum Analytics, Inc. 17 | # 18 | # MIT License 19 | # 20 | # Permission is hereby granted, free of charge, to any person obtaining 21 | # a copy of this software and associated documentation files 22 | # (the "Software"), to deal in the Software without restriction, including 23 | # without limitation the rights to use, copy, modify, merge, publish, 24 | # distribute, sublicense, and/or sell copies of the Software, and to permit 25 | # persons to whom the Software is furnished to do so, subject to 26 | # the following conditions: 27 | # 28 | # The above copyright notice and this permission notice shall be included 29 | # in all copies or substantial portions of the Software. 30 | # 31 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 32 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 34 | # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 35 | # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 36 | # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 37 | # OTHER DEALINGS IN THE SOFTWARE. 38 | # 39 | #============================================================================ 40 | 41 | # Finding NumPy involves calling the Python interpreter 42 | if(NumPy_FIND_REQUIRED) 43 | find_package(PythonInterp REQUIRED) 44 | else() 45 | find_package(PythonInterp) 46 | endif() 47 | 48 | if(NOT PYTHONINTERP_FOUND) 49 | set(NUMPY_FOUND FALSE) 50 | endif() 51 | 52 | execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" 53 | "import numpy as n; print(n.__version__); print(n.get_include());" 54 | RESULT_VARIABLE _NUMPY_SEARCH_SUCCESS 55 | OUTPUT_VARIABLE _NUMPY_VALUES 56 | ERROR_VARIABLE _NUMPY_ERROR_VALUE 57 | OUTPUT_STRIP_TRAILING_WHITESPACE) 58 | 59 | if(NOT _NUMPY_SEARCH_SUCCESS MATCHES 0) 60 | if(NumPy_FIND_REQUIRED) 61 | message(FATAL_ERROR 62 | "NumPy import failure:\n${_NUMPY_ERROR_VALUE}") 63 | endif() 64 | set(NUMPY_FOUND FALSE) 65 | endif() 66 | 67 | # Convert the process output into a list 68 | string(REGEX REPLACE ";" "\\\\;" _NUMPY_VALUES ${_NUMPY_VALUES}) 69 | string(REGEX REPLACE "\n" ";" _NUMPY_VALUES ${_NUMPY_VALUES}) 70 | list(GET _NUMPY_VALUES 0 NUMPY_VERSION) 71 | list(GET _NUMPY_VALUES 1 NUMPY_INCLUDE_DIRS) 72 | 73 | # Make sure all directory separators are '/' 74 | string(REGEX REPLACE "\\\\" "/" NUMPY_INCLUDE_DIRS ${NUMPY_INCLUDE_DIRS}) 75 | 76 | # Get the major and minor version numbers 77 | string(REGEX REPLACE "\\." ";" _NUMPY_VERSION_LIST ${NUMPY_VERSION}) 78 | list(GET _NUMPY_VERSION_LIST 0 NUMPY_VERSION_MAJOR) 79 | list(GET _NUMPY_VERSION_LIST 1 NUMPY_VERSION_MINOR) 80 | list(GET _NUMPY_VERSION_LIST 2 NUMPY_VERSION_PATCH) 81 | string(REGEX MATCH "[0-9]*" NUMPY_VERSION_PATCH ${NUMPY_VERSION_PATCH}) 82 | math(EXPR NUMPY_VERSION_DECIMAL 83 | "(${NUMPY_VERSION_MAJOR} * 10000) + (${NUMPY_VERSION_MINOR} * 100) + ${NUMPY_VERSION_PATCH}") 84 | 85 | find_package_message(NUMPY 86 | "Found NumPy: version \"${NUMPY_VERSION}\" ${NUMPY_INCLUDE_DIRS}" 87 | "${NUMPY_INCLUDE_DIRS}${NUMPY_VERSION}") 88 | 89 | set(NUMPY_FOUND TRUE) 90 | -------------------------------------------------------------------------------- /{{cookiecutter.github_project_name}}/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, Extension 2 | from setuptools.command.build_ext import build_ext 3 | import sys 4 | import os 5 | import setuptools 6 | 7 | __version__ = '0.0.1' 8 | 9 | 10 | class get_pybind_include(object): 11 | """Helper class to determine the pybind11 include path 12 | 13 | The purpose of this class is to postpone importing pybind11 14 | until it is actually installed, so that the ``get_include()`` 15 | method can be invoked. """ 16 | 17 | def __init__(self, user=False): 18 | self.user = user 19 | 20 | def __str__(self): 21 | import pybind11 22 | return pybind11.get_include(self.user) 23 | 24 | 25 | class get_numpy_include(object): 26 | """Helper class to determine the numpy include path 27 | 28 | The purpose of this class is to postpone importing numpy 29 | until it is actually installed, so that the ``get_include()`` 30 | method can be invoked. """ 31 | 32 | def __init__(self): 33 | pass 34 | 35 | def __str__(self): 36 | import numpy as np 37 | return np.get_include() 38 | 39 | 40 | ext_modules = [ 41 | Extension( 42 | '{{ cookiecutter.python_package_name }}', 43 | ['src/main.cpp'], 44 | include_dirs=[ 45 | # Path to pybind11 headers 46 | get_pybind_include(), 47 | get_pybind_include(user=True), 48 | get_numpy_include(), 49 | os.path.join(sys.prefix, 'include'), 50 | os.path.join(sys.prefix, 'Library', 'include') 51 | ], 52 | language='c++' 53 | ), 54 | ] 55 | 56 | 57 | def has_flag(compiler, flagname): 58 | """Return a boolean indicating whether a flag name is supported on 59 | the specified compiler. 60 | """ 61 | import tempfile 62 | with tempfile.NamedTemporaryFile('w', suffix='.cpp') as f: 63 | f.write('int main (int argc, char **argv) { return 0; }') 64 | try: 65 | compiler.compile([f.name], extra_postargs=[flagname]) 66 | except setuptools.distutils.errors.CompileError: 67 | return False 68 | return True 69 | 70 | 71 | def cpp_flag(compiler): 72 | """Return the -std=c++14 compiler flag and errors when the flag is 73 | no available. 74 | """ 75 | if has_flag(compiler, '-std=c++14'): 76 | return '-std=c++14' 77 | else: 78 | raise RuntimeError('C++14 support is required by xtensor!') 79 | 80 | 81 | class BuildExt(build_ext): 82 | """A custom build extension for adding compiler-specific options.""" 83 | c_opts = { 84 | 'msvc': ['/EHsc'], 85 | 'unix': [], 86 | } 87 | 88 | if sys.platform == 'darwin': 89 | c_opts['unix'] += ['-stdlib=libc++', '-mmacosx-version-min=10.7'] 90 | 91 | def build_extensions(self): 92 | ct = self.compiler.compiler_type 93 | opts = self.c_opts.get(ct, []) 94 | if ct == 'unix': 95 | opts.append('-DVERSION_INFO="%s"' % self.distribution.get_version()) 96 | opts.append(cpp_flag(self.compiler)) 97 | if has_flag(self.compiler, '-fvisibility=hidden'): 98 | opts.append('-fvisibility=hidden') 99 | elif ct == 'msvc': 100 | opts.append('/DVERSION_INFO=\\"%s\\"' % self.distribution.get_version()) 101 | for ext in self.extensions: 102 | ext.extra_compile_args = opts 103 | build_ext.build_extensions(self) 104 | 105 | setup( 106 | name='{{ cookiecutter.python_package_name }}', 107 | version=__version__, 108 | author='{{ cookiecutter.author_name }}', 109 | author_email='{{ cookiecutter.author_email }}', 110 | url='https://github.com/{{ cookiecutter.github_organization_name }}/{{ cookiecutter.github_project_name }}', 111 | description= '{{ cookiecutter.project_short_description }}', 112 | long_description='', 113 | ext_modules=ext_modules, 114 | install_requires=['pybind11>=2.0.1', 'numpy'], 115 | cmdclass={'build_ext': BuildExt}, 116 | zip_safe=False, 117 | ) 118 | -------------------------------------------------------------------------------- /{{cookiecutter.github_project_name}}/docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM Command file for Sphinx documentation 4 | 5 | if "%SPHINXBUILD%" == "" ( 6 | set SPHINXBUILD=sphinx-build 7 | ) 8 | set BUILDDIR=_build 9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . 10 | set I18NSPHINXOPTS=%SPHINXOPTS% . 11 | if NOT "%PAPER%" == "" ( 12 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% 13 | set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% 14 | ) 15 | 16 | if "%1" == "" goto help 17 | 18 | if "%1" == "help" ( 19 | :help 20 | echo.Please use `make ^` where ^ is one of 21 | echo. html to make standalone HTML files 22 | echo. dirhtml to make HTML files named index.html in directories 23 | echo. singlehtml to make a single large HTML file 24 | echo. pickle to make pickle files 25 | echo. json to make JSON files 26 | echo. htmlhelp to make HTML files and a HTML help project 27 | echo. qthelp to make HTML files and a qthelp project 28 | echo. devhelp to make HTML files and a Devhelp project 29 | echo. epub to make an epub 30 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter 31 | echo. text to make text files 32 | echo. man to make manual pages 33 | echo. texinfo to make Texinfo files 34 | echo. gettext to make PO message catalogs 35 | echo. changes to make an overview over all changed/added/deprecated items 36 | echo. xml to make Docutils-native XML files 37 | echo. pseudoxml to make pseudoxml-XML files for display purposes 38 | echo. linkcheck to check all external links for integrity 39 | echo. doctest to run all doctests embedded in the documentation if enabled 40 | echo. coverage to run coverage check of the documentation if enabled 41 | goto end 42 | ) 43 | 44 | if "%1" == "clean" ( 45 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i 46 | del /q /s %BUILDDIR%\* 47 | goto end 48 | ) 49 | 50 | 51 | REM Check if sphinx-build is available and fallback to Python version if any 52 | %SPHINXBUILD% 1>NUL 2>NUL 53 | if errorlevel 9009 goto sphinx_python 54 | goto sphinx_ok 55 | 56 | :sphinx_python 57 | 58 | set SPHINXBUILD=python -m sphinx.__init__ 59 | %SPHINXBUILD% 2> nul 60 | if errorlevel 9009 ( 61 | echo. 62 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 63 | echo.installed, then set the SPHINXBUILD environment variable to point 64 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 65 | echo.may add the Sphinx directory to PATH. 66 | echo. 67 | echo.If you don't have Sphinx installed, grab it from 68 | echo.http://sphinx-doc.org/ 69 | exit /b 1 70 | ) 71 | 72 | :sphinx_ok 73 | 74 | 75 | if "%1" == "html" ( 76 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html 77 | if errorlevel 1 exit /b 1 78 | echo. 79 | echo.Build finished. The HTML pages are in %BUILDDIR%/html. 80 | goto end 81 | ) 82 | 83 | if "%1" == "dirhtml" ( 84 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml 85 | if errorlevel 1 exit /b 1 86 | echo. 87 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. 88 | goto end 89 | ) 90 | 91 | if "%1" == "singlehtml" ( 92 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml 93 | if errorlevel 1 exit /b 1 94 | echo. 95 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. 96 | goto end 97 | ) 98 | 99 | if "%1" == "pickle" ( 100 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle 101 | if errorlevel 1 exit /b 1 102 | echo. 103 | echo.Build finished; now you can process the pickle files. 104 | goto end 105 | ) 106 | 107 | if "%1" == "json" ( 108 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json 109 | if errorlevel 1 exit /b 1 110 | echo. 111 | echo.Build finished; now you can process the JSON files. 112 | goto end 113 | ) 114 | 115 | if "%1" == "htmlhelp" ( 116 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp 117 | if errorlevel 1 exit /b 1 118 | echo. 119 | echo.Build finished; now you can run HTML Help Workshop with the ^ 120 | .hhp project file in %BUILDDIR%/htmlhelp. 121 | goto end 122 | ) 123 | 124 | if "%1" == "qthelp" ( 125 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp 126 | if errorlevel 1 exit /b 1 127 | echo. 128 | echo.Build finished; now you can run "qcollectiongenerator" with the ^ 129 | .qhcp project file in %BUILDDIR%/qthelp, like this: 130 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\python_example.qhcp 131 | echo.To view the help file: 132 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\python_example.ghc 133 | goto end 134 | ) 135 | 136 | if "%1" == "devhelp" ( 137 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp 138 | if errorlevel 1 exit /b 1 139 | echo. 140 | echo.Build finished. 141 | goto end 142 | ) 143 | 144 | if "%1" == "epub" ( 145 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub 146 | if errorlevel 1 exit /b 1 147 | echo. 148 | echo.Build finished. The epub file is in %BUILDDIR%/epub. 149 | goto end 150 | ) 151 | 152 | if "%1" == "latex" ( 153 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 154 | if errorlevel 1 exit /b 1 155 | echo. 156 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. 157 | goto end 158 | ) 159 | 160 | if "%1" == "latexpdf" ( 161 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 162 | cd %BUILDDIR%/latex 163 | make all-pdf 164 | cd %~dp0 165 | echo. 166 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 167 | goto end 168 | ) 169 | 170 | if "%1" == "latexpdfja" ( 171 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 172 | cd %BUILDDIR%/latex 173 | make all-pdf-ja 174 | cd %~dp0 175 | echo. 176 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 177 | goto end 178 | ) 179 | 180 | if "%1" == "text" ( 181 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text 182 | if errorlevel 1 exit /b 1 183 | echo. 184 | echo.Build finished. The text files are in %BUILDDIR%/text. 185 | goto end 186 | ) 187 | 188 | if "%1" == "man" ( 189 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man 190 | if errorlevel 1 exit /b 1 191 | echo. 192 | echo.Build finished. The manual pages are in %BUILDDIR%/man. 193 | goto end 194 | ) 195 | 196 | if "%1" == "texinfo" ( 197 | %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo 198 | if errorlevel 1 exit /b 1 199 | echo. 200 | echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. 201 | goto end 202 | ) 203 | 204 | if "%1" == "gettext" ( 205 | %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale 206 | if errorlevel 1 exit /b 1 207 | echo. 208 | echo.Build finished. The message catalogs are in %BUILDDIR%/locale. 209 | goto end 210 | ) 211 | 212 | if "%1" == "changes" ( 213 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes 214 | if errorlevel 1 exit /b 1 215 | echo. 216 | echo.The overview file is in %BUILDDIR%/changes. 217 | goto end 218 | ) 219 | 220 | if "%1" == "linkcheck" ( 221 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck 222 | if errorlevel 1 exit /b 1 223 | echo. 224 | echo.Link check complete; look for any errors in the above output ^ 225 | or in %BUILDDIR%/linkcheck/output.txt. 226 | goto end 227 | ) 228 | 229 | if "%1" == "doctest" ( 230 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest 231 | if errorlevel 1 exit /b 1 232 | echo. 233 | echo.Testing of doctests in the sources finished, look at the ^ 234 | results in %BUILDDIR%/doctest/output.txt. 235 | goto end 236 | ) 237 | 238 | if "%1" == "coverage" ( 239 | %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage 240 | if errorlevel 1 exit /b 1 241 | echo. 242 | echo.Testing of coverage in the sources finished, look at the ^ 243 | results in %BUILDDIR%/coverage/python.txt. 244 | goto end 245 | ) 246 | 247 | if "%1" == "xml" ( 248 | %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml 249 | if errorlevel 1 exit /b 1 250 | echo. 251 | echo.Build finished. The XML files are in %BUILDDIR%/xml. 252 | goto end 253 | ) 254 | 255 | if "%1" == "pseudoxml" ( 256 | %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml 257 | if errorlevel 1 exit /b 1 258 | echo. 259 | echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. 260 | goto end 261 | ) 262 | 263 | :end 264 | -------------------------------------------------------------------------------- /{{cookiecutter.github_project_name}}/docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = _build 9 | 10 | # User-friendly check for sphinx-build 11 | ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) 12 | $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) 13 | endif 14 | 15 | # Internal variables. 16 | PAPEROPT_a4 = -D latex_paper_size=a4 17 | PAPEROPT_letter = -D latex_paper_size=letter 18 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 19 | # the i18n builder cannot share the environment and doctrees with the others 20 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 21 | 22 | .PHONY: help 23 | help: 24 | @echo "Please use \`make ' where is one of" 25 | @echo " html to make standalone HTML files" 26 | @echo " dirhtml to make HTML files named index.html in directories" 27 | @echo " singlehtml to make a single large HTML file" 28 | @echo " pickle to make pickle files" 29 | @echo " json to make JSON files" 30 | @echo " htmlhelp to make HTML files and a HTML help project" 31 | @echo " qthelp to make HTML files and a qthelp project" 32 | @echo " applehelp to make an Apple Help Book" 33 | @echo " devhelp to make HTML files and a Devhelp project" 34 | @echo " epub to make an epub" 35 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 36 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 37 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" 38 | @echo " text to make text files" 39 | @echo " man to make manual pages" 40 | @echo " texinfo to make Texinfo files" 41 | @echo " info to make Texinfo files and run them through makeinfo" 42 | @echo " gettext to make PO message catalogs" 43 | @echo " changes to make an overview of all changed/added/deprecated items" 44 | @echo " xml to make Docutils-native XML files" 45 | @echo " pseudoxml to make pseudoxml-XML files for display purposes" 46 | @echo " linkcheck to check all external links for integrity" 47 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 48 | @echo " coverage to run coverage check of the documentation (if enabled)" 49 | 50 | .PHONY: clean 51 | clean: 52 | rm -rf $(BUILDDIR)/* 53 | 54 | .PHONY: html 55 | html: 56 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 57 | @echo 58 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 59 | 60 | .PHONY: dirhtml 61 | dirhtml: 62 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 63 | @echo 64 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 65 | 66 | .PHONY: singlehtml 67 | singlehtml: 68 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 69 | @echo 70 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 71 | 72 | .PHONY: pickle 73 | pickle: 74 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 75 | @echo 76 | @echo "Build finished; now you can process the pickle files." 77 | 78 | .PHONY: json 79 | json: 80 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 81 | @echo 82 | @echo "Build finished; now you can process the JSON files." 83 | 84 | .PHONY: htmlhelp 85 | htmlhelp: 86 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 87 | @echo 88 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 89 | ".hhp project file in $(BUILDDIR)/htmlhelp." 90 | 91 | .PHONY: qthelp 92 | qthelp: 93 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 94 | @echo 95 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 96 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 97 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/python_example.qhcp" 98 | @echo "To view the help file:" 99 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/python_example.qhc" 100 | 101 | .PHONY: applehelp 102 | applehelp: 103 | $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp 104 | @echo 105 | @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." 106 | @echo "N.B. You won't be able to view it unless you put it in" \ 107 | "~/Library/Documentation/Help or install it in your application" \ 108 | "bundle." 109 | 110 | .PHONY: devhelp 111 | devhelp: 112 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 113 | @echo 114 | @echo "Build finished." 115 | @echo "To view the help file:" 116 | @echo "# mkdir -p $$HOME/.local/share/devhelp/python_example" 117 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/python_example" 118 | @echo "# devhelp" 119 | 120 | .PHONY: epub 121 | epub: 122 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 123 | @echo 124 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 125 | 126 | .PHONY: latex 127 | latex: 128 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 129 | @echo 130 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 131 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 132 | "(use \`make latexpdf' here to do that automatically)." 133 | 134 | .PHONY: latexpdf 135 | latexpdf: 136 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 137 | @echo "Running LaTeX files through pdflatex..." 138 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 139 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 140 | 141 | .PHONY: latexpdfja 142 | latexpdfja: 143 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 144 | @echo "Running LaTeX files through platex and dvipdfmx..." 145 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja 146 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 147 | 148 | .PHONY: text 149 | text: 150 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 151 | @echo 152 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 153 | 154 | .PHONY: man 155 | man: 156 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 157 | @echo 158 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 159 | 160 | .PHONY: texinfo 161 | texinfo: 162 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 163 | @echo 164 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 165 | @echo "Run \`make' in that directory to run these through makeinfo" \ 166 | "(use \`make info' here to do that automatically)." 167 | 168 | .PHONY: info 169 | info: 170 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 171 | @echo "Running Texinfo files through makeinfo..." 172 | make -C $(BUILDDIR)/texinfo info 173 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 174 | 175 | .PHONY: gettext 176 | gettext: 177 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 178 | @echo 179 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 180 | 181 | .PHONY: changes 182 | changes: 183 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 184 | @echo 185 | @echo "The overview file is in $(BUILDDIR)/changes." 186 | 187 | .PHONY: linkcheck 188 | linkcheck: 189 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 190 | @echo 191 | @echo "Link check complete; look for any errors in the above output " \ 192 | "or in $(BUILDDIR)/linkcheck/output.txt." 193 | 194 | .PHONY: doctest 195 | doctest: 196 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 197 | @echo "Testing of doctests in the sources finished, look at the " \ 198 | "results in $(BUILDDIR)/doctest/output.txt." 199 | 200 | .PHONY: coverage 201 | coverage: 202 | $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage 203 | @echo "Testing of coverage in the sources finished, look at the " \ 204 | "results in $(BUILDDIR)/coverage/python.txt." 205 | 206 | .PHONY: xml 207 | xml: 208 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml 209 | @echo 210 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml." 211 | 212 | .PHONY: pseudoxml 213 | pseudoxml: 214 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml 215 | @echo 216 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." 217 | -------------------------------------------------------------------------------- /{{cookiecutter.github_project_name}}/Test_Run.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": { 7 | "collapsed": true 8 | }, 9 | "outputs": [], 10 | "source": [ 11 | "import numpy as np\n", 12 | "import {{ cookiecutter.python_package_name }} as xt\n", 13 | "\n", 14 | "from IPython.display import display" 15 | ] 16 | }, 17 | { 18 | "cell_type": "markdown", 19 | "metadata": {}, 20 | "source": [ 21 | "### Function example1" 22 | ] 23 | }, 24 | { 25 | "cell_type": "code", 26 | "execution_count": 25, 27 | "metadata": { 28 | "collapsed": false 29 | }, 30 | "outputs": [ 31 | { 32 | "name": "stdout", 33 | "output_type": "stream", 34 | "text": [ 35 | "example1(arg0: numpy.ndarray[float]) -> float\n", 36 | "\n", 37 | "Return the first element of an array, of dimension at least one\n", 38 | "\n" 39 | ] 40 | } 41 | ], 42 | "source": [ 43 | "print(xt.example1.__doc__)" 44 | ] 45 | }, 46 | { 47 | "cell_type": "code", 48 | "execution_count": 6, 49 | "metadata": { 50 | "collapsed": false 51 | }, 52 | "outputs": [ 53 | { 54 | "data": { 55 | "text/plain": [ 56 | "array([[ 5, 6, 7, 8, 9],\n", 57 | " [10, 11, 12, 13, 14],\n", 58 | " [15, 16, 17, 18, 19]])" 59 | ] 60 | }, 61 | "metadata": {}, 62 | "output_type": "display_data" 63 | }, 64 | { 65 | "data": { 66 | "text/plain": [ 67 | "5.0" 68 | ] 69 | }, 70 | "metadata": {}, 71 | "output_type": "display_data" 72 | } 73 | ], 74 | "source": [ 75 | "a = np.arange(15).reshape(3, 5) + 5\n", 76 | "b = xt.example1(a)\n", 77 | "display(a)\n", 78 | "display(b)" 79 | ] 80 | }, 81 | { 82 | "cell_type": "markdown", 83 | "metadata": {}, 84 | "source": [ 85 | "### Function example2" 86 | ] 87 | }, 88 | { 89 | "cell_type": "code", 90 | "execution_count": 26, 91 | "metadata": { 92 | "collapsed": false 93 | }, 94 | "outputs": [ 95 | { 96 | "name": "stdout", 97 | "output_type": "stream", 98 | "text": [ 99 | "example2(arg0: numpy.ndarray[float]) -> numpy.ndarray[float]\n", 100 | "\n", 101 | "Return the the specified array plus 2\n", 102 | "\n" 103 | ] 104 | } 105 | ], 106 | "source": [ 107 | "print(xt.example2.__doc__)" 108 | ] 109 | }, 110 | { 111 | "cell_type": "code", 112 | "execution_count": 7, 113 | "metadata": { 114 | "collapsed": false 115 | }, 116 | "outputs": [ 117 | { 118 | "data": { 119 | "text/plain": [ 120 | "array([[ 0, 1, 2, 3, 4],\n", 121 | " [ 5, 6, 7, 8, 9],\n", 122 | " [10, 11, 12, 13, 14]])" 123 | ] 124 | }, 125 | "metadata": {}, 126 | "output_type": "display_data" 127 | }, 128 | { 129 | "data": { 130 | "text/plain": [ 131 | "array([[ 2., 3., 4., 5., 6.],\n", 132 | " [ 7., 8., 9., 10., 11.],\n", 133 | " [ 12., 13., 14., 15., 16.]])" 134 | ] 135 | }, 136 | "metadata": {}, 137 | "output_type": "display_data" 138 | } 139 | ], 140 | "source": [ 141 | "a = np.arange(15).reshape(3, 5)\n", 142 | "b = xt.example2(a)\n", 143 | "display(a)\n", 144 | "display(b)" 145 | ] 146 | }, 147 | { 148 | "cell_type": "markdown", 149 | "metadata": {}, 150 | "source": [ 151 | "### Function readme_example1" 152 | ] 153 | }, 154 | { 155 | "cell_type": "code", 156 | "execution_count": 27, 157 | "metadata": { 158 | "collapsed": false 159 | }, 160 | "outputs": [ 161 | { 162 | "name": "stdout", 163 | "output_type": "stream", 164 | "text": [ 165 | "readme_example1(arg0: numpy.ndarray[float]) -> float\n", 166 | "\n", 167 | "Accumulate the sines of all the values of the specified array\n", 168 | "\n" 169 | ] 170 | } 171 | ], 172 | "source": [ 173 | "print(xt.readme_example1.__doc__)" 174 | ] 175 | }, 176 | { 177 | "cell_type": "code", 178 | "execution_count": 31, 179 | "metadata": { 180 | "collapsed": false, 181 | "scrolled": false 182 | }, 183 | "outputs": [ 184 | { 185 | "data": { 186 | "text/plain": [ 187 | "array([ 0. , 0.03173326, 0.06346652, 0.09519978, 0.12693304,\n", 188 | " 0.1586663 , 0.19039955, 0.22213281, 0.25386607, 0.28559933,\n", 189 | " 0.31733259, 0.34906585, 0.38079911, 0.41253237, 0.44426563,\n", 190 | " 0.47599889, 0.50773215, 0.53946541, 0.57119866, 0.60293192,\n", 191 | " 0.63466518, 0.66639844, 0.6981317 , 0.72986496, 0.76159822,\n", 192 | " 0.79333148, 0.82506474, 0.856798 , 0.88853126, 0.92026451,\n", 193 | " 0.95199777, 0.98373103, 1.01546429, 1.04719755, 1.07893081,\n", 194 | " 1.11066407, 1.14239733, 1.17413059, 1.20586385, 1.23759711,\n", 195 | " 1.26933037, 1.30106362, 1.33279688, 1.36453014, 1.3962634 ,\n", 196 | " 1.42799666, 1.45972992, 1.49146318, 1.52319644, 1.5549297 ,\n", 197 | " 1.58666296, 1.61839622, 1.65012947, 1.68186273, 1.71359599,\n", 198 | " 1.74532925, 1.77706251, 1.80879577, 1.84052903, 1.87226229,\n", 199 | " 1.90399555, 1.93572881, 1.96746207, 1.99919533, 2.03092858,\n", 200 | " 2.06266184, 2.0943951 , 2.12612836, 2.15786162, 2.18959488,\n", 201 | " 2.22132814, 2.2530614 , 2.28479466, 2.31652792, 2.34826118,\n", 202 | " 2.37999443, 2.41172769, 2.44346095, 2.47519421, 2.50692747,\n", 203 | " 2.53866073, 2.57039399, 2.60212725, 2.63386051, 2.66559377,\n", 204 | " 2.69732703, 2.72906028, 2.76079354, 2.7925268 , 2.82426006,\n", 205 | " 2.85599332, 2.88772658, 2.91945984, 2.9511931 , 2.98292636,\n", 206 | " 3.01465962, 3.04639288, 3.07812614, 3.10985939, 3.14159265])" 207 | ] 208 | }, 209 | "metadata": {}, 210 | "output_type": "display_data" 211 | }, 212 | { 213 | "data": { 214 | "text/plain": [ 215 | "63.02006849910228" 216 | ] 217 | }, 218 | "metadata": {}, 219 | "output_type": "display_data" 220 | }, 221 | { 222 | "data": { 223 | "text/plain": [ 224 | "63.02006849910227" 225 | ] 226 | }, 227 | "metadata": {}, 228 | "output_type": "display_data" 229 | } 230 | ], 231 | "source": [ 232 | "PI = np.pi\n", 233 | "a = np.linspace(0, PI, 100)\n", 234 | "b = xt.readme_example1(a)\n", 235 | "display(a)\n", 236 | "display(np.sin(a).sum())\n", 237 | "display(b)" 238 | ] 239 | }, 240 | { 241 | "cell_type": "markdown", 242 | "metadata": {}, 243 | "source": [ 244 | "### Function vectorize_example1" 245 | ] 246 | }, 247 | { 248 | "cell_type": "code", 249 | "execution_count": 28, 250 | "metadata": { 251 | "collapsed": false 252 | }, 253 | "outputs": [ 254 | { 255 | "name": "stdout", 256 | "output_type": "stream", 257 | "text": [ 258 | "vectorize_example1(arg0: numpy.ndarray[float], arg1: numpy.ndarray[float]) -> numpy.ndarray[float]\n", 259 | "\n", 260 | "Add the sine and and cosine of the two specified values\n", 261 | "\n" 262 | ] 263 | } 264 | ], 265 | "source": [ 266 | "print(xt.vectorize_example1.__doc__)" 267 | ] 268 | }, 269 | { 270 | "cell_type": "code", 271 | "execution_count": 37, 272 | "metadata": { 273 | "collapsed": false 274 | }, 275 | "outputs": [ 276 | { 277 | "data": { 278 | "text/plain": [ 279 | "array([ 0. , 0.34906585, 0.6981317 , 1.04719755, 1.3962634 ,\n", 280 | " 1.74532925, 2.0943951 , 2.44346095, 2.7925268 , 3.14159265])" 281 | ] 282 | }, 283 | "metadata": {}, 284 | "output_type": "display_data" 285 | }, 286 | { 287 | "data": { 288 | "text/plain": [ 289 | "array([ 0. , 0.6981317 , 1.3962634 , 2.0943951 , 2.7925268 ,\n", 290 | " 3.4906585 , 4.1887902 , 4.88692191, 5.58505361, 6.28318531])" 291 | ] 292 | }, 293 | "metadata": {}, 294 | "output_type": "display_data" 295 | }, 296 | { 297 | "data": { 298 | "text/plain": [ 299 | "array([ 1. , 1.10806459, 0.81643579, 0.3660254 , 0.04511513,\n", 300 | " 0.04511513, 0.3660254 , 0.81643579, 1.10806459, 1. ])" 301 | ] 302 | }, 303 | "metadata": {}, 304 | "output_type": "display_data" 305 | }, 306 | { 307 | "data": { 308 | "text/plain": [ 309 | "array([ True, True, True, True, True, True, True, True, True, True], dtype=bool)" 310 | ] 311 | }, 312 | "metadata": {}, 313 | "output_type": "display_data" 314 | } 315 | ], 316 | "source": [ 317 | "PI = np.pi\n", 318 | "a = np.linspace(0, PI, 10)\n", 319 | "b = np.linspace(0, 2*PI, 10)\n", 320 | "c = xt.vectorize_example1(a, b)\n", 321 | "d = np.sin(a)+np.cos(b)\n", 322 | "display(a)\n", 323 | "display(b)\n", 324 | "display(c)\n", 325 | "display(np.isclose(c, d))" 326 | ] 327 | } 328 | ], 329 | "metadata": { 330 | "kernelspec": { 331 | "display_name": "Python 3", 332 | "language": "python", 333 | "name": "python3" 334 | }, 335 | "language_info": { 336 | "codemirror_mode": { 337 | "name": "ipython", 338 | "version": 3 339 | }, 340 | "file_extension": ".py", 341 | "mimetype": "text/x-python", 342 | "name": "python", 343 | "nbconvert_exporter": "python", 344 | "pygments_lexer": "ipython3", 345 | "version": "3.5.2" 346 | } 347 | }, 348 | "nbformat": 4, 349 | "nbformat_minor": 2 350 | } 351 | -------------------------------------------------------------------------------- /{{cookiecutter.github_project_name}}/docs/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # {{ cookiecutter.python_package_name }} documentation build configuration file, created by 4 | # sphinx-quickstart on Fri Feb 26 00:29:33 2016. 5 | # 6 | # This file is execfile()d with the current directory set to its 7 | # containing dir. 8 | # 9 | # Note that not all possible configuration values are present in this 10 | # autogenerated file. 11 | # 12 | # All configuration values have a default; values that are commented out 13 | # serve to show the default. 14 | 15 | import sys 16 | import os 17 | 18 | # If extensions (or modules to document with autodoc) are in another directory, 19 | # add these directories to sys.path here. If the directory is relative to the 20 | # documentation root, use os.path.abspath to make it absolute, like shown here. 21 | #sys.path.insert(0, os.path.abspath('.')) 22 | 23 | # -- General configuration ------------------------------------------------ 24 | 25 | # If your documentation needs a minimal Sphinx version, state it here. 26 | #needs_sphinx = '1.0' 27 | 28 | # Add any Sphinx extension module names here, as strings. They can be 29 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 30 | # ones. 31 | extensions = [ 32 | 'sphinx.ext.autodoc', 33 | 'sphinx.ext.intersphinx', 34 | 'sphinx.ext.autosummary', 35 | 'sphinx.ext.napoleon', 36 | ] 37 | 38 | autosummary_generate = True 39 | 40 | # Add any paths that contain templates here, relative to this directory. 41 | templates_path = ['_templates'] 42 | 43 | # The suffix(es) of source filenames. 44 | # You can specify multiple suffix as a list of string: 45 | # source_suffix = ['.rst', '.md'] 46 | source_suffix = '.rst' 47 | 48 | # The encoding of source files. 49 | #source_encoding = 'utf-8-sig' 50 | 51 | # The master toctree document. 52 | master_doc = 'index' 53 | 54 | # General information about the project. 55 | project = u'{{ cookiecutter.python_package_name }}' 56 | copyright = u'2016, {{ cookiecutter.author_name }}' 57 | author = u'{{ cookiecutter.author_name }}' 58 | 59 | # The version info for the project you're documenting, acts as replacement for 60 | # |version| and |release|, also used in various other places throughout the 61 | # built documents. 62 | # 63 | # The short X.Y version. 64 | version = u'0.0.1' 65 | # The full version, including alpha/beta/rc tags. 66 | release = u'0.0.1' 67 | 68 | # The language for content autogenerated by Sphinx. Refer to documentation 69 | # for a list of supported languages. 70 | # 71 | # This is also used if you do content translation via gettext catalogs. 72 | # Usually you set "language" from the command line for these cases. 73 | language = None 74 | 75 | # There are two options for replacing |today|: either, you set today to some 76 | # non-false value, then it is used: 77 | #today = '' 78 | # Else, today_fmt is used as the format for a strftime call. 79 | #today_fmt = '%B %d, %Y' 80 | 81 | # List of patterns, relative to source directory, that match files and 82 | # directories to ignore when looking for source files. 83 | exclude_patterns = ['_build'] 84 | 85 | # The reST default role (used for this markup: `text`) to use for all 86 | # documents. 87 | #default_role = None 88 | 89 | # If true, '()' will be appended to :func: etc. cross-reference text. 90 | #add_function_parentheses = True 91 | 92 | # If true, the current module name will be prepended to all description 93 | # unit titles (such as .. function::). 94 | #add_module_names = True 95 | 96 | # If true, sectionauthor and moduleauthor directives will be shown in the 97 | # output. They are ignored by default. 98 | #show_authors = False 99 | 100 | # The name of the Pygments (syntax highlighting) style to use. 101 | pygments_style = 'sphinx' 102 | 103 | # A list of ignored prefixes for module index sorting. 104 | #modindex_common_prefix = [] 105 | 106 | # If true, keep warnings as "system message" paragraphs in the built documents. 107 | #keep_warnings = False 108 | 109 | # If true, `todo` and `todoList` produce output, else they produce nothing. 110 | todo_include_todos = False 111 | 112 | 113 | # -- Options for HTML output ---------------------------------------------- 114 | 115 | # The theme to use for HTML and HTML Help pages. See the documentation for 116 | # a list of builtin themes. 117 | html_theme = 'alabaster' 118 | 119 | # Theme options are theme-specific and customize the look and feel of a theme 120 | # further. For a list of options available for each theme, see the 121 | # documentation. 122 | #html_theme_options = {} 123 | 124 | # Add any paths that contain custom themes here, relative to this directory. 125 | #html_theme_path = [] 126 | 127 | # The name for this set of Sphinx documents. If None, it defaults to 128 | # " v documentation". 129 | #html_title = None 130 | 131 | # A shorter title for the navigation bar. Default is the same as html_title. 132 | #html_short_title = None 133 | 134 | # The name of an image file (relative to this directory) to place at the top 135 | # of the sidebar. 136 | #html_logo = None 137 | 138 | # The name of an image file (within the static path) to use as favicon of the 139 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 140 | # pixels large. 141 | #html_favicon = None 142 | 143 | # Add any paths that contain custom static files (such as style sheets) here, 144 | # relative to this directory. They are copied after the builtin static files, 145 | # so a file named "default.css" will overwrite the builtin "default.css". 146 | #html_static_path = ['_static'] 147 | 148 | # Add any extra paths that contain custom files (such as robots.txt or 149 | # .htaccess) here, relative to this directory. These files are copied 150 | # directly to the root of the documentation. 151 | #html_extra_path = [] 152 | 153 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 154 | # using the given strftime format. 155 | #html_last_updated_fmt = '%b %d, %Y' 156 | 157 | # If true, SmartyPants will be used to convert quotes and dashes to 158 | # typographically correct entities. 159 | #html_use_smartypants = True 160 | 161 | # Custom sidebar templates, maps document names to template names. 162 | #html_sidebars = {} 163 | 164 | # Additional templates that should be rendered to pages, maps page names to 165 | # template names. 166 | #html_additional_pages = {} 167 | 168 | # If false, no module index is generated. 169 | #html_domain_indices = True 170 | 171 | # If false, no index is generated. 172 | #html_use_index = True 173 | 174 | # If true, the index is split into individual pages for each letter. 175 | #html_split_index = False 176 | 177 | # If true, links to the reST sources are added to the pages. 178 | #html_show_sourcelink = True 179 | 180 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 181 | #html_show_sphinx = True 182 | 183 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 184 | #html_show_copyright = True 185 | 186 | # If true, an OpenSearch description file will be output, and all pages will 187 | # contain a tag referring to it. The value of this option must be the 188 | # base URL from which the finished HTML is served. 189 | #html_use_opensearch = '' 190 | 191 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 192 | #html_file_suffix = None 193 | 194 | # Language to be used for generating the HTML full-text search index. 195 | # Sphinx supports the following languages: 196 | # 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' 197 | # 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' 198 | #html_search_language = 'en' 199 | 200 | # A dictionary with options for the search language support, empty by default. 201 | # Now only 'ja' uses this config value 202 | #html_search_options = {'type': 'default'} 203 | 204 | # The name of a javascript file (relative to the configuration directory) that 205 | # implements a search results scorer. If empty, the default will be used. 206 | #html_search_scorer = 'scorer.js' 207 | 208 | # Output file base name for HTML help builder. 209 | htmlhelp_basename = '{{ cookiecutter.python_package_name }}doc' 210 | 211 | # -- Options for LaTeX output --------------------------------------------- 212 | 213 | latex_elements = { 214 | # The paper size ('letterpaper' or 'a4paper'). 215 | #'papersize': 'letterpaper', 216 | 217 | # The font size ('10pt', '11pt' or '12pt'). 218 | #'pointsize': '10pt', 219 | 220 | # Additional stuff for the LaTeX preamble. 221 | #'preamble': '', 222 | 223 | # Latex figure (float) alignment 224 | #'figure_align': 'htbp', 225 | } 226 | 227 | # Grouping the document tree into LaTeX files. List of tuples 228 | # (source start file, target name, title, 229 | # author, documentclass [howto, manual, or own class]). 230 | latex_documents = [ 231 | (master_doc, '{{ cookiecutter.python_package_name }}.tex', u'{{ cookiecutter.python_package_name }} Documentation', 232 | u'{{ cookiecutter.author_name }}', 'manual'), 233 | ] 234 | 235 | # The name of an image file (relative to this directory) to place at the top of 236 | # the title page. 237 | #latex_logo = None 238 | 239 | # For "manual" documents, if this is true, then toplevel headings are parts, 240 | # not chapters. 241 | #latex_use_parts = False 242 | 243 | # If true, show page references after internal links. 244 | #latex_show_pagerefs = False 245 | 246 | # If true, show URL addresses after external links. 247 | #latex_show_urls = False 248 | 249 | # Documents to append as an appendix to all manuals. 250 | #latex_appendices = [] 251 | 252 | # If false, no module index is generated. 253 | #latex_domain_indices = True 254 | 255 | 256 | # -- Options for manual page output --------------------------------------- 257 | 258 | # One entry per manual page. List of tuples 259 | # (source start file, name, description, authors, manual section). 260 | man_pages = [ 261 | (master_doc, '{{ cookiecutter.python_package_name }}', u'{{ cookiecutter.python_package_name }} Documentation', 262 | [author], 1) 263 | ] 264 | 265 | # If true, show URL addresses after external links. 266 | #man_show_urls = False 267 | 268 | 269 | # -- Options for Texinfo output ------------------------------------------- 270 | 271 | # Grouping the document tree into Texinfo files. List of tuples 272 | # (source start file, target name, title, author, 273 | # dir menu entry, description, category) 274 | texinfo_documents = [ 275 | (master_doc, '{{ cookiecutter.python_package_name }}', u'{{ cookiecutter.python_package_name }} Documentation', 276 | author, '{{ cookiecutter.python_package_name }}', 'One line description of project.', 277 | 'Miscellaneous'), 278 | ] 279 | 280 | # Documents to append as an appendix to all manuals. 281 | #texinfo_appendices = [] 282 | 283 | # If false, no module index is generated. 284 | #texinfo_domain_indices = True 285 | 286 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 287 | #texinfo_show_urls = 'footnote' 288 | 289 | # If true, do not generate a @detailmenu in the "Top" node's menu. 290 | #texinfo_no_detailmenu = False 291 | 292 | 293 | # Example configuration for intersphinx: refer to the Python standard library. 294 | intersphinx_mapping = {'https://docs.python.org/': None} 295 | --------------------------------------------------------------------------------