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.
Please refer to the documentation and to the examples folder for details on how to use RoughPy. If you want to implement more complex functions built on top of RoughPy, you may also want to check out the roughpy/tensor_functions.py file to see how the "LOG" function is implemented for free tensor objects.
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.
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.
Intervals in RoughPy
RoughPy is very careful in how it works with intervals. One design goal is that it should be able to handle jumps in the underlying signal that occur at particular times, including the beginning or end of the interval, and still guarantee that if you combine the signature over adjacent interval, you always get the signature over the entire interval. This implies that there has to be a decision about whether data at the exact beginning or exact end of the interval is included. The convention in RoughPy are that we use clopen intervals, and that data at beginning of the interval is seen, and data at the end of the interval is seen in the next interval. A second design goal is that the code should be efficient, and so the internal representation of a stream involves caching the signature over dyadic intervals of different resolutions. Recovering the signature over any interval using the cache has logarithmic complexity (using at most 2n tensor multiplications, when n is the internal resolution of the stream). Resolution refers to the length of the finest granularity at which we will store information about the underlying data. Any event occurs within one of these finest granularity intervals, multiple events occur within the same interval resolve to a more complex log-signature which correctly reflects the time sequence of the events within this grain of time. However, no query of the stream is allowed to see finer resolution than the internal resolution of the stream, it is only allowed to access the information over intervals that are a union of these finest resolution granular intervals. For this reason, a query over any interval is replaced by a query is replaced by a query over an interval whose endpoints have been shifted to be consistent with the granular resolution, obtained by rounding these points to the contained end-point of the unique clopen granular interval containing this point. In particular, if both the left-hand and right-hand ends of the interval are contained in the clopen granular interval, we round the interval to the empty interval. Specifying a resolution of 32 or 64 equates to using integer arithmetic.
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.1.2
- Documentation is now in sync with the main branch (@philipparubin PR #85)
- Fixed a fault when constructing with larger than expected array (Issue #70, @inakleinbottle PR #72)
- Updated README to remove old information, users should now read roughpy.org (Issue #74, @inakleinbottle PR #71, #78)
- Fixed degree argument on basis size function (Issue #75, @inakleinbottle PR #79)
- Fixed unknown keyword arguments not flagged (Issue #77, @inakleinbottle PR #81)
- Fixed partition intermediates unchecked by Python constructor (Issue #80, @inakleinbottle PR #82)
- Fixed path constructors now accept Lies (Issue #83, @inakleinbottle PR #87)
Version 0.1.1:
- Fixed type promotions in scalar arithmetic - left hand types are now promoted when appropriate.
- Added "tensor_functions" module for implementing additional functions on tensors. Currently only Log is implemented.
- Fixed a few bugs in the build system
Version 0.1.0:
- Added framework for integrating device support and redesigned scalars module to accommodate the changes.
- Made changes to type deduction in constructors to avoid exceptions when providing lists of python ints/floats.
- Changed the implementation of array for algebra types. A copy is always made, and the size of the array is always equal to the dimension of the chosen width/depth composition.
- Changed the behaviour when no resolution is given. RoughPy now uses a heuristic to compute a suitable resolution for computing signatures if none is given.
Version 0.0.8:
- Disabled linking to BLAS/LAPACK to reduce compile times whilst under development.
- Greatly expanded the serialization support internally.
- Many classes can now be pickled/unpickled for transport across process boundaries. (Note that this is not yet a safe means of storing and transmitting stream data.)
- Overlay triplets are now forced for all builds. This should improve reproducibility.
- Restructured the algebra module to improve build times.
- Added CMake detection of headers to help builds with non-compliant compilers.
- Fixed an error in the construction of
PyLieKey
inPyLieKeyIterator
. #40
Version 0.0.7:
- Overhaul the (internal) ScalarType API: . the overloads of convert_copy have been removed in favour of the variant that takes two ScalarPointers; . the single versions of add(_inplace) and friends have been replaced with more flexible add_into; batch compute methods and friends; . replaced single value uminus with uminus into with similar signature to to add_into and friends; . removed single value copy method;
- Added constructor for ScalarPointer from type_id and pointer.
- Implementations of ScalarType methods that are essentially the same for all types are implemented in a common implementation layer.
- Added threading support in platform
- add_into and friends have threading support if available and enabled.
- Added default implementation of type_id_of so that non-specialized types look for a ScalarType object.
- Greatly simplified the design of ScalarMatrix - it now only supports full, dense matrices.
- Redesigned the interface between the Scalar linear algebra and MKL/BLAS+LAPACK.
- Added function to query ring characteristics of a ScalarType - currently unused.
- Added KeyScalarStream for constructing streams from array-like data more easily.
- Implemented the
from_type_details
function for scalar types. This fixes a bug when constructing objects using the dlpack protocol. - Overhaul constructor for
LieIncrementStream
s from increment data to reduce number of copies (if possible) and to handle non-contiguous or oddly shaped data correctly. - Change implementation of
LieIncrementStream
to allow adding the parameter channel during construction. - Change implementation of
TickStream
to allow adding parameter channel during construction.
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.1.2-cp313-cp313-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ea49a0c27fdd5a94024d1a9128182913a909b41c709b2f73773cb15d2f25e20 |
|
MD5 | ad3fa7533f714752c04cee732370cf0f |
|
BLAKE2b-256 | 67fd1929d233ae83f126c95efbe3172fc74773d89a850c738201aadfb7e071e4 |
Hashes for roughpy-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e71b0f6324da5fbee136be9d966d1e2a475cd0d693bf14c8efc73f91bb52e682 |
|
MD5 | 0e48d41eb6729e0a519bc4a5bbd3811b |
|
BLAKE2b-256 | fcd74f9b8d56e185d8f683ebaa479c4cb767099ff5b2ce6f6479a6c4fdc89d4f |
Hashes for roughpy-0.1.2-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f63d8ec95e3637a9041c2595f3123cf50b6c19f8aa153dd8bbdd257f186ce33 |
|
MD5 | 7e0d9b732aa907f6d79c2c12377a6fb4 |
|
BLAKE2b-256 | 61cb7cfd36f7b52d04c0a5709211af6967a8c2154c877b0ca42627ff69105f51 |
Hashes for roughpy-0.1.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b19f2253a786b255cc2c99fb4c93c36771260bce0cb4d15ec0648f745c20c5a3 |
|
MD5 | 6dc07bebad5935e3074a254194dfabd7 |
|
BLAKE2b-256 | 9055246aab40a98d58725452813daed6b9a26401903dd13ca73eafc32f3b8cda |
Hashes for roughpy-0.1.2-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23402628243384cd084ab269f53eb312758e39810fa671dd9bf9404660a06768 |
|
MD5 | 653149e8f6b84e5b031cb62ba476635f |
|
BLAKE2b-256 | b6b3670367851aa380b77f706eb61502fa3d995589d81279968ff91bfbad0a00 |
Hashes for roughpy-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab235be925ef7abc02908a0906b80fdd5cda5edae217799a2ea03c4eca9a3b68 |
|
MD5 | 08bd80b76443bf9e27a45fcea6c2ce8a |
|
BLAKE2b-256 | 5801b4bde06606cb189d7037e5bdcb94b49b779bdf400239b9ee3c15a065ec6c |
Hashes for roughpy-0.1.2-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0467dbae80335c827326a414f4e3d2a21486e6593e200e63c90c5bca8570565c |
|
MD5 | 223de2083d28d6fc528758cf7a604170 |
|
BLAKE2b-256 | aed73a2d80d8f7a6e3cb59afdf1170683635e35c8345d49ab5d864aa06d10de5 |
Hashes for roughpy-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be124c36668e137c4de24ae5d05c68110d7dd011a7e756a1eff4644253dc730f |
|
MD5 | 81d95f0338652b404c81521bdc29b168 |
|
BLAKE2b-256 | 8b145dc34130b982fd98493690ccc412497e1b5f88a2c1694ba84e90fde03542 |
Hashes for roughpy-0.1.2-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c42616b7975e07360d500552ecf0f199077bdb78f6d41c0fee12df79882d9204 |
|
MD5 | fdd1f7b169873290010815a2172109db |
|
BLAKE2b-256 | bf558a129e41a39be611703e1e96be5724b07f6c6c28daef55a4ac9e0544ac48 |
Hashes for roughpy-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b709433c5e43271a363d83a8fd77770ab181a5d206210ce37f32cd21ac1263b |
|
MD5 | eda273b6b695447db866cea5b7bf32b6 |
|
BLAKE2b-256 | db6336db237a5bf5d5713f41431ea445512d863b15071495bd03cc0671d0d294 |
Hashes for roughpy-0.1.2-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfe6bb0b5944d5de98422790a4df0d13d4a41bb5915562afe2e813edd1bf0d68 |
|
MD5 | 16bffb0a7fd6a487c060a81299d4b857 |
|
BLAKE2b-256 | d8747b1b639b94ba428e291638b7ef1c901d21dd2269d4df3c1375e6b2503e02 |
Hashes for roughpy-0.1.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2658c22989bdfcffcb48d02645f0a37b214398c6f96fc998ec61df5a858116a |
|
MD5 | e6c82583c08ff1b57ab426d88e5ecb87 |
|
BLAKE2b-256 | 4b7fb53439d9f03b2feeca6bfac6a2fe8f8ba3be4e46ce55f6370bdb4c6962e9 |
Hashes for roughpy-0.1.2-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a583d4299a1db7d7ef66734e7ebb786bf3d4e930ef7dd80f77617bc8740f661 |
|
MD5 | 23c8e86c96344902d5cfb09f988d190a |
|
BLAKE2b-256 | 689cabe8ec4a9ceeeffa3017b603303bc9436c6402cf7bf2cd26a16c5d30d6d4 |
Hashes for roughpy-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1504355f02b5785c1a93b0885882f47e0a095c5647eb3f11863e05ee445ef52a |
|
MD5 | 902df45057194365ad6393dc27d603b3 |
|
BLAKE2b-256 | ee1b57bcf7e51bc89cf1a45a72df730536fa7225cc3f0f125c0a2c6135285614 |
Hashes for roughpy-0.1.2-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c7876c7bb54c09b24f913c357dbb66a774f34529c5e1ab18f5829638f40fb02 |
|
MD5 | 1896f97b5a7a9c4c73dda390d3597617 |
|
BLAKE2b-256 | c5770ef08d29d101fb0a0ba3d1cdc065189272a21267232e120231d66a8fb14a |
Hashes for roughpy-0.1.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37f53ac6b00b4ecacec5cef3bd18b73e26bf8fa0a4550846abd8029510f988e4 |
|
MD5 | a65557ea9479f7b321e362b579fee713 |
|
BLAKE2b-256 | c44bbefe05fcebe7edfcff185d6718baa06f8ffa76d7936cd5807ec9dbd23849 |
Hashes for roughpy-0.1.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 102689318d58935cd19323ebf8e8a928f405812d9bb15b8e3b42c37df081b050 |
|
MD5 | 82946ba42e396a78615a85f4f80290a7 |
|
BLAKE2b-256 | 3e3523c22bef566733c6b55309b9638eef374eb8bdd44a738efa8ea4c67b770c |
Hashes for roughpy-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d00b317ba7ff2b1e7f67eedb07dc838a3b39e1069440a046e9a0f3d4a80c0b3c |
|
MD5 | 88096e614345f10b4c8d9ee4b166600f |
|
BLAKE2b-256 | 8eba337d3f816bef43535429f7d5b0a4d7d62e3b443818181eb4c3b1850373c7 |
Hashes for roughpy-0.1.2-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4628d4473aba2c25726148670e2e60e38908e73e8ae9ecc87beeb059e321f61 |
|
MD5 | e4360922bcd84c139478ffa414ac07f9 |
|
BLAKE2b-256 | 1139ea27fa85285ccde2eb4ea5121e2d8e8aa65a8bc98c0409f312e0fb64f1b0 |
Hashes for roughpy-0.1.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8ae3a85551e7bd8ae87e7919ec4995689f2577cb5826fcba7f8a678f6607463 |
|
MD5 | 1f10d00adc6db181dbd8fde8e466f4e4 |
|
BLAKE2b-256 | 1df425a0c54a5dc730f610ac65be773348c9b7d0d84d8634fb7567cf75446eea |