No project description provided
Project description
RoughPy
RoughPy is a package for working with streaming data as rough paths, and working with algebraic objects such as free tensors, shuffle tensors, and elements of the free Lie algebra.
This library is currently in an alpha stage, and as such many features are still incomplete or not fully implemented. Please bear this in mind when looking at the source code.
Installation
RoughPy can be installed from PyPI using pip
on Windows, Linux, and MacOS (Intel based Mac only, sorry not Apple Silicon support yet). Simply run
pip install roughpy
to get the latest version.
Alternatively, the wheel files can be downloaded from the Releases page.
Installing from source
RoughPy can be installed from source, although this is not the recommended way to install. The build system requires vcpkg in order to obtain the necessary dependencies (except for MKL on x86 platforms, which is installed via pip). You will need to make sure that vcpkg is available on your system before attempting to build RoughPy. The following commands should be sufficient to set up the environment for building RoughPy:
git clone https://github.com/Microsoft/vcpkg.git tools/vcpkg
tools/vcpkg/bootstrap-vcpkg.sh
export CMAKE_TOOLCHAIN_FILE=$(pwd)/tools/vcpkg/scripts/buildsystems/vcpkg.cmake
With this environment variable set, most of the dependencies will be installed automatically during the build process.
On MacOS with Apple Silicon you will need to install libomp (for example using Homebrew brew install libomp
).
This is not necessary on Intel based MacOS where the Intel iomp5 can be used instead.
The build system will use brew --prefix libomp
to try to locate this library.
(The actual brew
executable can be customised by setting the ROUGHPY_BREW_EXECUTABLE
CMake variable
or environment variable.)
You should now be able to pip install either using the PyPI source distribution (using the --no-binary :roughpy:
flag), or directly from GitHub (recommended):
pip install git+https://github.com/datasig-ac-uk/RoughPy.git
It will take some time to build.
Usage
Following the NumPy (and related) convention, we import RoughPy under the alias rp
as follows:
import roughpy as rp
The main object(s) that you will interact with are Stream
objects or the family of factory classes such as LieIncrementStream
. For example, we can create a LieIncrementStream
using the following commands:
stream = rp.LieIncrementStream.from_increments([[0., 1., 2.], [3., 4., 5.]], depth=2)
This will create a stream whose (hidden) underlying data are the two increments [0., 1., 2.]
and [3., 4., 5.]
, and whose algebra elements are truncated at maximum depth 2.
To compute the log signature over an interval we use the log_signature
method on the stream, for example
interval = rp.RealInterval(0., 1.)
lsig = stream.log_signature(interval)
Printing this new object lsig
should give the following result
{ 1(2) 2(3) }
which is the first increment from the underlying data. (By default, the increments are assumed to occur at parameter values equal to their row index in the provided data.)
Similarly, the signature can be computed using the signature
method on the stream object:
sig = stream.signature(interval)
Notice that the lsig
and sig
objects have types Lie
and FreeTensor
, respectively. They behave exactly as you would expect elements of these algebras to behave. Moreover, they will (usually) be convertible directly to a NumPy array (or TensorFlow, PyTorch, JAX tensor type in the future) of the underlying data, so you can interact with them as if they were simple arrays.
Support
If you have a specific problem, the best way to record this is to open an issue on GitHub. We welcome any feedback or bug reports.
Contributing
In the future, we will welcome pull requests to implement new features, fix bugs, add documentation or examples, or add tests to the project. However, at present, we do not have robust CI pipelines set up to rigorously test incoming changes, and therefor will not be accepting pull requests made from outside the current team.
Contributors
The full list of contributors is listed in THANKS
alongside this readme. The people mentioned in this document constitute The RoughPy Developers
.
License
RoughPy is licensed under a BSD-3-Clause license. This was chosen specifically to match the license of NumPy.
Changelog
Version 0.0.6:
- Externally sourced streams (sound-file streams) now support setting channel types/schema in factory function.
- Added option for customising file name macro in exception throws.
- Made some improvements to the internal interface of ScalarType to allow more efficient implementations of vectorised operations.
- Added fast "is_zero" method to Python algebra objects.
Version 0.0.5:
- Added free functions for performing free-tensor, shuffle, half-shuffle multiplication between pairs of tensors (of either kind).
- Added free function for applying the adjoint of left free tensor multiplication to arbitrary tensors.
- Improved exception usage, messages now include filename, lineno, and function name to help locate c++ exceptions passed through to Python.
- Basis objects in Python are now iterable.
- Added
split_n
andto_index
methods to Tensor key.
Version 0.0.4:
- Overhauled the RPY_CHECK macro so it now gives much better contextual information.
- Readme updated to reflect PyPI installation with wheels.
- Antipode is now implemented in libalgebra_lite, and exposed to Python for Free tensors.
- Streams now carry a support interval, outside of which the signature will be return trivial.
- Build requirements fixed for non x86 platforms.
- Expanded coverage of pytype stub file.
Version 0.0.3:
- Added datetime interval support.
- Integrated schema reparametrisation into stream signature methods.
- Fixed bug in names of scalar types, names now display correctly.
- Fixed bfloat16 given wrong scalar type code.
- Added half precision float and bfloat16 to py module
- Added real partition class and Python interface.
- Implemented simplify method on Streams.
- Added polynomial coefficients
- started an examples folder
Version 0.0.2-alpha:
- Added datetime and timedelta object support to tick data parsing.
- Expanded build system to include more versions of Python.
- Stabilised compilation on all three platforms.
- Fixed numerous bugs in the build system.
Version 0.0.1-alpha:
- First alpha release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for roughpy-0.0.6-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55352c0b362518cb3d0ed395d57ff011c1e408a5a526a208b53ac75545af7da3 |
|
MD5 | 08607b69d15385ddd29cdd3ae65d6335 |
|
BLAKE2b-256 | 255e321964bd328ec7e3c9e375d3939e3865c038074e8062a73e606efe89ede9 |
Hashes for roughpy-0.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40026171fb0fa40d190201a077ea7deec81b0bf7d3ead94e9c70132e66e6f028 |
|
MD5 | e646c6e0d8a1a3c7074f038fd0f49252 |
|
BLAKE2b-256 | 9639ab4ab646b1a3bd82ac1c300cea48a523a9d03e7e322982809c6cf150e0a6 |
Hashes for roughpy-0.0.6-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3812cf26698029460a6b39148476a5a97502dad7817ac6a61cdb4ff5702fb35a |
|
MD5 | da508b50a0d836bdb712dfeac1f8df47 |
|
BLAKE2b-256 | b6713be0b688f14002d037800d071d1a49b0de3d17341678de95db9c95b22a98 |
Hashes for roughpy-0.0.6-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9e639bafbcc0194aad7b8778258aff90a6b08a0c157abf8f4b886d163030769 |
|
MD5 | 476f2190bcb6f5d3aa01875e38c98749 |
|
BLAKE2b-256 | f3e1d92698510ae5cfc5946b0896228bd63dfabc84aec056c65de18b88c9b778 |
Hashes for roughpy-0.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1522e826268f601c703156d4a31b38e38cf4b36797a33e00b01626bb08c9c394 |
|
MD5 | 85c277ecf673b5f192a5e1a83d536ca0 |
|
BLAKE2b-256 | db39288828520e003fb6e86d6ad8d17ac8ffaab724e42dc60148daae6997a11d |
Hashes for roughpy-0.0.6-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 043694376115ba148feec41f1764171946883b39bf2e220b7fc5ca6498430b83 |
|
MD5 | c563c3b0c3086712224af1c674569572 |
|
BLAKE2b-256 | 99956478a7cd8cd25ded6b459ab12538cb99f0029563917520e16fd1229bc940 |
Hashes for roughpy-0.0.6-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d109011d33c29ba2d5e77d044d65464687c5b1917b3fb47d8ee5597454bb435d |
|
MD5 | ebf037f1935ba9e133ee369f8bbdc733 |
|
BLAKE2b-256 | 91cfd8310a8c36f240a57eb09247d060b4660960a4a6cdad90e898168dd4c02c |
Hashes for roughpy-0.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45fbe26ff92787431eab446e75a4ab89800ca6fcb81abae03be76fd821d3cc4e |
|
MD5 | 23f23c0a9914baa1d98801d476953d09 |
|
BLAKE2b-256 | a3c666eaf7a91b912bfd151705a11df35ade91e5d7313ac2ff126ae259fe653b |
Hashes for roughpy-0.0.6-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7d52be355bde637d49b962540458d52b8e21e3114867c532c00284bee9f9a3d |
|
MD5 | 8bd9231d83acd1aa244ef433ecbc7239 |
|
BLAKE2b-256 | ba000581817631a0f38b00e420e743dabd7d6bde47576482c24d841eeaaebf73 |
Hashes for roughpy-0.0.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddd06bc327efad3848cd8258bb7c1ebd2716036f9eb7563d0d2baa5579a1e99d |
|
MD5 | c80d92d37a7ceb1867bef494e44451e8 |
|
BLAKE2b-256 | 89ca7aca37e46aab9796679cd688dca3c517a6adc2c26a36be50880107add6a9 |