source: doc/python_module.rst @ 39d6fba

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5
Last change on this file since 39d6fba was 39d6fba, checked in by Paul Brossier <piem@piem.org>, 5 years ago

[doc] move python tests from python/README.md to doc/python_module.rst

  • Property mode set to 100644
File size: 1.8 KB
RevLine 
[68daf5b]1.. _python-install:
[d44763f]2
[68daf5b]3Installing aubio for Python
4===========================
[34abeaf]5
[d44763f]6The aubio extension for Python is available for Python 2.7 and Python 3.
7
[5417b3a]8Installing aubio with pip
9-------------------------
[241e2fb]10
[a9a1e79]11aubio can now be installed using ``pip``:
[d44763f]12
[3d8a6c0]13.. code-block:: console
[241e2fb]14
15    $ pip install aubio
16
[34abeaf]17Building the module
18-------------------
19
20From ``aubio`` source directory, run the following:
21
[3d8a6c0]22.. code-block:: console
[34abeaf]23
[241e2fb]24    $ ./setup.py clean
[34abeaf]25    $ ./setup.py build
26    $ sudo ./setup.py install
27
[6d4802f]28
29.. _py-doubleprecision:
30
31Double precision
32----------------
33
34This module can be compiled in double-precision mode, in which case the
35default type for floating-point samples will be 64-bit. The default is
36single precision mode (32-bit, recommended).
37
38To build the aubio module with double precision, use the option
39`--enable-double` of the `build_ext` subcommand:
40
41.. code:: bash
42
43    $ ./setup.py clean
44    $ ./setup.py build_ext --enable-double
45    $ pip install -v .
46
47**Note**: If linking against `libaubio`, make sure the library was also
48compiled in :ref:`doubleprecision` mode.
49
50
[f8bf0c2]51Checking your installation
52--------------------------
[5417b3a]53
[109ba42]54Once the python module is installed, its version can be checked with:
55
56.. code-block:: console
57
58    $ python -c "import aubio; print(aubio.version, aubio.float_type)"
59
60The command line `aubio` is also installed:
61
62.. code-block:: console
63
64    $ aubio -h
[34abeaf]65
[5417b3a]66
67Python tests
68------------
69
[39d6fba]70A number of Python tests are provided in the `python tests`_. To run them,
71install `nose2`_ and run the script ``python/tests/run_all_tests``:
72
73.. code-block:: console
74
75    $ pip install nose2
76    $ ./python/tests/run_all_tests
[5417b3a]77
78.. _demo_filter.py: https://github.com/aubio/aubio/blob/master/python/demos/demo_filter.py
[d44763f]79.. _python tests: https://github.com/aubio/aubio/blob/master/python/tests
[39d6fba]80.. _nose2: https://github.com/nose-devs/nose2
Note: See TracBrowser for help on using the repository browser.