Symbolic computations.
Project description
symba
In what follows python
is an alias for python3.5
or pypy3.5
or any later version (python3.6
, pypy3.6
and so on).
Installation
Install the latest pip
& setuptools
packages versions
python -m pip install --upgrade pip setuptools
User
Download and install the latest stable version from PyPI
repository
python -m pip install --upgrade symba
Developer
Download the latest version from GitHub
repository
git clone https://github.com/lycantropos/symba.git
cd symba
Install dependencies
python -m pip install -r requirements.txt
Install
python setup.py install
Usage
>>> from symba.base import Expression, sqrt
>>> golden_ratio = (1 + sqrt(5)) / 2
>>> isinstance(golden_ratio, Expression)
True
>>> golden_ratio * golden_ratio == golden_ratio + 1
True
>>> 1 / golden_ratio == golden_ratio - 1
True
>>> def fibonacci(index: int) -> Expression:
... """
... Based on:
... https://en.wikipedia.org/wiki/Golden_ratio#Relationship_to_Fibonacci_sequence
... """
... golden_ratio_power = golden_ratio ** index
... return ((golden_ratio_power - (-1) ** index / golden_ratio_power)
... / sqrt(5))
>>> fibonacci(0) == 0
True
>>> fibonacci(1) == 1
True
>>> fibonacci(100) == 354224848179261915075
True
Development
Bumping version
Preparation
Install bump2version.
Pre-release
Choose which version number category to bump following semver specification.
Test bumping version
bump2version --dry-run --verbose $CATEGORY
where $CATEGORY
is the target version number category name, possible
values are patch
/minor
/major
.
Bump version
bump2version --verbose $CATEGORY
This will set version to major.minor.patch-alpha
.
Release
Test bumping version
bump2version --dry-run --verbose release
Bump version
bump2version --verbose release
This will set version to major.minor.patch
.
Running tests
Install dependencies
python -m pip install -r requirements-tests.txt
Plain
pytest
Inside Docker
container:
- with
CPython
docker-compose --file docker-compose.cpython.yml up
- with
PyPy
docker-compose --file docker-compose.pypy.yml up
Bash
script (e.g. can be used in Git
hooks):
-
with
CPython
./run-tests.sh
or
./run-tests.sh cpython
-
with
PyPy
./run-tests.sh pypy
PowerShell
script (e.g. can be used in Git
hooks):
- with
CPython
.\run-tests.ps1
or.\run-tests.ps1 cpython
- with
PyPy
.\run-tests.ps1 pypy
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 symba-0.4.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a348241146a889582b75b92c3e6957062c7ad17d5dcda94a97eb141b730f90e1 |
|
MD5 | d1eb964d02b3a42eb8d8ebae3dc8c91a |
|
BLAKE2b-256 | 4d48aff14f2c780f1cbcd2bfcdbd08446af9878cb6b64b3cec73474a3fa4a0ab |
Hashes for symba-0.4.2-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c38314dc39cda663181ee0c148439e5e20bb5ce46b6b6e07bffff0e60fde7369 |
|
MD5 | 228d043a7620df04a6fe0cc468056b5b |
|
BLAKE2b-256 | fd7b12de71cfb238a74a80398f8a9f13d078546e967c0f1c72dec95104627b65 |
Hashes for symba-0.4.2-cp39-cp39-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89769c90e6c2244fc9f24e562b25eae65da7c0c3ebf0d1487e699b3ee9cfa1d6 |
|
MD5 | 636dc3210a2036482234b3ee2ecf2307 |
|
BLAKE2b-256 | e3a6684b23f743a3993f26a4c878bc4cdd4a60b05b1684f8044f861f8b2a905a |
Hashes for symba-0.4.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70f75b96b694539a2c940dbdd62d889ffaa80b243e88ffb34daee69e5e73e69c |
|
MD5 | c5d549c59d4e684695798dba2dfe7344 |
|
BLAKE2b-256 | d50a06ce5c353b0d857a4c70dc2e3f3526db58aa84a686aadcae198f984a00ea |
Hashes for symba-0.4.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48d4f7702084267e6777982a531578d7d1ee32e440f3cdf8be530dab6e3a9736 |
|
MD5 | e56f7ad648fe217893ab210952925265 |
|
BLAKE2b-256 | 8fda60908507abed6fd6dd248ac418d0ff902da0dc5792c4b197141cb950d838 |
Hashes for symba-0.4.2-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b00b8c0a9df1307c8ddbaf82d265139dc91d50526ecd0e77881d87e2a439abc6 |
|
MD5 | f001cda5ef638b2949b00b79d0116da9 |
|
BLAKE2b-256 | 8002c9b5277ac07b55bfc0556373210ed36ac15106caeb3fa15a832c09199ffb |
Hashes for symba-0.4.2-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0155d313f91d148de21d9be53443012416f07fa7f70f98bbab07b89453402775 |
|
MD5 | 135a460bde222417a5e03ab52cde620b |
|
BLAKE2b-256 | ab47a30ec84562d0c2f6e1be0c397bc14c1bdea61826f4f8ee04de27749cd3b1 |
Hashes for symba-0.4.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3296f8e14ef4ccd69217828240669e063fa710d1d27719d11e721069c91edce |
|
MD5 | 89ef1b546dccb61b7d0e7e61b46cb2cd |
|
BLAKE2b-256 | 073ca048505b754e6a58ec536744d67cd0e0b030a6154627483ef07d95c37752 |
Hashes for symba-0.4.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4c671f85fcf6d09fad75202d9ae4a970032afde97c0302564e0c9d752c4160c |
|
MD5 | 31bdb82f6f8a4124b2124f68535f345c |
|
BLAKE2b-256 | 5e25aba018a98679987bb900015e4efce0b0a3096ca79cd4c6a173dd3dd202d9 |
Hashes for symba-0.4.2-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e91d04dc4c1d1da1519ca1f887d20e642e4c350044729b5370a891a95800352 |
|
MD5 | e202c161af6eda2e40de09b06c1f5e14 |
|
BLAKE2b-256 | 38a895222b9653de77fcc63a02dc503e0c35117e3267235ead69089f499ffb5c |
Hashes for symba-0.4.2-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19f700d4c0799f2898163578f6e107f1be693c27eedb412b212d1d6e93d4f84b |
|
MD5 | 6a35591103ae6d9fa7ce27f63b0bd705 |
|
BLAKE2b-256 | bba28d333e066c1c23e4fab73b54b9b74386bd41e4d3e17af67051db2763bf22 |
Hashes for symba-0.4.2-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 359cef51c57256a0b7242ba1f1e64e84d9c2a1f5a297b78fc7ef2a95d8795621 |
|
MD5 | d1d8105ef4f1c32bfddd19c52302d688 |
|
BLAKE2b-256 | 4942c5d3e9a8ab0e472ca05d0b813b282b6bae716741078bc0b062dc82df8127 |
Hashes for symba-0.4.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f5a5c2c27f60963ebcdab3e4be4ba6192bcdf234ece5f01cec87f9355bcdcb9 |
|
MD5 | efbe8fbaf32932fe235d1d900e875f74 |
|
BLAKE2b-256 | 8197d3afae05196e09fcd2e4243735e613cb4495d5bef22d0615d91a6016de75 |
Hashes for symba-0.4.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5ab5a587386485cda4ddcfbe228165ec37d7b3545b3ad6d3bca755f51d33f89 |
|
MD5 | fcd924bd3e7e10978b7098fcd44d5ab3 |
|
BLAKE2b-256 | 73df2fe665c6fd40742db70b4958e5be5e1aac18af84de028dfd8cfb1fa46f4f |
Hashes for symba-0.4.2-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f69665dc551f03b9167b554d59e9a603e411766800be31ad2886e731e6498f01 |
|
MD5 | cc5b0abdb381c711114963fe71df1aa0 |
|
BLAKE2b-256 | 2febe6d54c0044195ba8a076578e4b155f5fdb9b007a0045893677e74d208156 |
Hashes for symba-0.4.2-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fef3dd7ad2532077da21a37af58c4fe70ecc2887749b37f0d38362f28690ed6 |
|
MD5 | 7ea8a2e2aa24ea8520278543461a8d52 |
|
BLAKE2b-256 | e0c0a1c37691353c4b14b88c37d25eca883746addd71a80caaa08ac87efbfc82 |
Hashes for symba-0.4.2-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b57ffe2097fee06fcccd30b40ffdaa0b0f304912f2b3676cacbe36cd061a33e9 |
|
MD5 | 9a3196fd8453e676f0c4ae27af57d16a |
|
BLAKE2b-256 | 8225bf31bd826efc21267ac8b85c74862b95752915e2b394551bd7354dab147b |
Hashes for symba-0.4.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cc4f6d8fa53e43932039b7f1bce6955f826349c19fafdeea6b4e94f53ecf75f |
|
MD5 | b6b964a49ca0463e32b9b035ab135860 |
|
BLAKE2b-256 | adebcc7e05e52fa2e9543f02f1edb6fddb7c908af14dbcc3b1196f50e3bc8b33 |
Hashes for symba-0.4.2-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee2df1755e97098ac2b33997e016cf5b1a993903fe902c94c5405071ee6b9a9c |
|
MD5 | b31db716c6542c2d415bd93c5cdbb1cd |
|
BLAKE2b-256 | 6e1bfcef13b7ebb41b002d04c6e5c9c02f93910fe460c4cdaeb79942ea494491 |
Hashes for symba-0.4.2-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5028c8a7670d11f79ce25ffc954f908f476bde8117134db53d510241a9da7fd |
|
MD5 | 2127f209772a35930708a4a31057ffd2 |
|
BLAKE2b-256 | be66eeed2c99dd3c8af71d9c1a702f77505dfc9f5735771469f9df20152d6c86 |
Hashes for symba-0.4.2-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 432ab122958c8656b69eca83a0343c1b05f4fc4842abf7a841744b9c13ab1815 |
|
MD5 | 8384054dd07891eeb224774d7cd5bfdc |
|
BLAKE2b-256 | 05fc7336ce4a46f631b6fccccfbd6bcaff6de9ff8b367ce94d0163ac35ec30a6 |
Hashes for symba-0.4.2-cp35-cp35m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c02f6f59717d3fa38020a3e66d1c59ab3d8836eebc1f764e77c50b5c0d2715d6 |
|
MD5 | 1784e0a831822966dbc088a2a2ef1bd6 |
|
BLAKE2b-256 | 747d2067bff0fe70df97b72d1ef2518c475694e9aed1362b27db2c963642b7b8 |
Hashes for symba-0.4.2-cp35-cp35m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d0db425a2ab26c92b0414746c6940c379bdb92daf72c74f1e354256a442848a |
|
MD5 | e630f20ac368d1e38e2b20cc1d7ebc9f |
|
BLAKE2b-256 | 2657f9252bfcba71d86e35927c905d1bc637ca2172eb8b5fdc93d2b5ab2bdaf7 |