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.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed3ea5a2e0b51fb4851c58711538bae60af73fbda731228bf4f6b1a2bcdc4fb6 |
|
MD5 | 0f3c61bc681e09f4193721d84ec43126 |
|
BLAKE2b-256 | 477231750838cb80c4443f3a33df138d9935da8220b79fc4a25f7119dbbb3b8b |
Hashes for symba-0.4.0-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6699a53f62546abd4dd32d5d341a0ebe9844e64ecd491e1fc9edeab175cd8200 |
|
MD5 | 4d42ede51f8110d85a2b51f722238839 |
|
BLAKE2b-256 | bfebcc98be411d9ae1d85370b66db539b71126fa2e7cb3c0a8a30353c1926e0b |
Hashes for symba-0.4.0-cp39-cp39-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b6f6d4e7c25f1a65f55eb5060e2411df95f4af7231ef4eb675087f36efbed24 |
|
MD5 | bfb8c921190c8d599ffb3b1dd7a7d7bd |
|
BLAKE2b-256 | da5ae9994daf7756f8ac7c977378b2a1438853a7f1364283e455fd851763c792 |
Hashes for symba-0.4.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16d44ac6620c54ac6554b347988bf077c909d5ce68c03850c45d6e076192cb0e |
|
MD5 | 0b837aa6ca3da44894cb5410a8b1750d |
|
BLAKE2b-256 | 6b103bc6d96c0b86ce1de2d828a95090665933133455fdf54769ec2b4db6429f |
Hashes for symba-0.4.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8341ad0a1f012c14a7c6606ae2ac40a2ae5e4a5e7b13ebb3c97654c45c64aaaa |
|
MD5 | 326174115ec62f46f42069c7c90c7263 |
|
BLAKE2b-256 | 9a644f7f87a025f157f1708347846f60fc63979e04a8b04860661c5f182bae72 |
Hashes for symba-0.4.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3002028e7b7732b66cd924a9419381d5cfd0b0f3889d66c0d3557a7b1b762548 |
|
MD5 | 4bece1d3806541c325e69d252039f190 |
|
BLAKE2b-256 | 567a8df88d64b5ef18f33894528d214432036b32b1f37955579b592658755115 |
Hashes for symba-0.4.0-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7bca2a20664ed645aee4fb326d76f7d7132065dca075ef7a6b33f8c051c58a0 |
|
MD5 | 808a5f9e58161e13b685bda5ac8e1946 |
|
BLAKE2b-256 | 2159d664baa2a526abd47c2d3fb84599de27c2bccd3bf4a3b7900f7d6980095b |
Hashes for symba-0.4.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0405bf68bb5b880244b174fe4dccd9e9a2004b537addd1d8c34fdf30284d16b0 |
|
MD5 | c15c76fb627d162c828d18b1817a2050 |
|
BLAKE2b-256 | dff2da0f570fef79e18b6d216a28f737cd46ba27712396245412c96fd6d3f07a |
Hashes for symba-0.4.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6da7323092b22c337d1da9741030ef955caeef042021fb5b0853fa5076fbeff7 |
|
MD5 | 08691def570160e6994bc7929bb6b0ef |
|
BLAKE2b-256 | 5c6c37d275bfe1dc95b54b8e844d168dda4da7c02278f86d4f889855eb40a54b |
Hashes for symba-0.4.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a840c51a693d38e50ed76c4a2d8abf9c9d9595fd4075776c09ff64e34bb45a93 |
|
MD5 | 828625eec4ed42b75466281d69db985c |
|
BLAKE2b-256 | fe1895819a4c7007148ca11b35f05741ce95c81f885399125b423fc9547ada42 |
Hashes for symba-0.4.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1ec83d14d5d5cead809c2077a8ec87ed44ca034a5d40aa3f563e2e132bbc824 |
|
MD5 | 8c1ddbe157a272745bdfe6e084360755 |
|
BLAKE2b-256 | 7c9827c91f7ff51c59eaaff3b93659f33ea6979a7c0acf65bc430f22b5e89423 |
Hashes for symba-0.4.0-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 772c7b7e9242f27b13a22dccbc912ee18d0de2ee8dbd073905ccde989ce520a3 |
|
MD5 | d015705e806470d3e0a805fa8380c2ba |
|
BLAKE2b-256 | e865f21b2c0d710b7ad346f4af625e059c8c63434e3a2844c344803d2fe669b0 |
Hashes for symba-0.4.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a1ffa302bf0c99348254229175e656ad30ab632d8e8360ae94443e2db8df7f8 |
|
MD5 | fdeee5872ab9eb47f01cabffa5fdf8b5 |
|
BLAKE2b-256 | 8b988a632bdaa1527a8bdaca5d1dc51dd282730d08f790b45c5e76f4ad3effe4 |
Hashes for symba-0.4.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64b97a89dc08537cb35912295d62b422d9f8bf92a1879760a0f044f11c1f2069 |
|
MD5 | 6c82252faafb562c5ac0b8c2320f7d44 |
|
BLAKE2b-256 | 18e19023b820f5b9b2a075998f39c3119a15459e077306560876d50614c14dcf |
Hashes for symba-0.4.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1aad6af7ce7177bce6e160e67415b5696741bf5e1432697762ee843dead9cade |
|
MD5 | e0e90a1c3f5a25e93eb5999a02dd66d2 |
|
BLAKE2b-256 | 3f6568ec6620b56cb1de1d652c4c25eebdd9c5186607225b6cab26dd417f07b9 |
Hashes for symba-0.4.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f70241841677d67b8618742ac7f676f17c1c3ace0f68a029460af3775b964e13 |
|
MD5 | 6dac0ba938e064a89632cda3f86d5407 |
|
BLAKE2b-256 | a6976f3cc070a8fb281f6c32c39ec8f0e4a221b95749142795eac0c63298b645 |
Hashes for symba-0.4.0-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b62f009d1a29ebbe04eb1c4aea90473438bd09edb5586c5cd0ffd85ced1fa85b |
|
MD5 | 444bcbb16399f868a1df62fae2db61a8 |
|
BLAKE2b-256 | 98f036e0fae1f20734360d868ab2700c8251324c9a6e17987f6c132cf4679314 |
Hashes for symba-0.4.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a1b4d1906ce3bde8234846f4117a848068fb22e011c3c08bdbdbe7b17a7851b |
|
MD5 | 8fe74a82f6e9773427248f7effd25ab5 |
|
BLAKE2b-256 | b574c02d9af32eb4650308d602e470f0a87ea72a7efe937538522d4a7ac359c2 |
Hashes for symba-0.4.0-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ac9c4eb509d3e1599788810a408abd20bff84cf2d8b800da36780b5ba16de2b |
|
MD5 | 4da0b3ca9caebb42530bd18329b73c7d |
|
BLAKE2b-256 | 78ed60b92dddec627908d38e87057993435d7ab9319c92ab5175c9495f4bfea4 |
Hashes for symba-0.4.0-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05ca314b562ce8ace574b250259cf0097afc825d5e8e7cbc4bba961f4af2b657 |
|
MD5 | ffc72a063736e4315922f42dee1f726b |
|
BLAKE2b-256 | 4fa145c85c50712bee72ec0c71095b2ffffce2424051502d15311ccb2efb8a43 |
Hashes for symba-0.4.0-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5af8d49a48b27ad0a0326e7db3696f01cd98a4d5740bde78ef99fbbe7a1c0fd7 |
|
MD5 | baf65731575b53e83ada539d5a728361 |
|
BLAKE2b-256 | d88b6fc5b03d57b2efdb632e8c805d46811a7525e21b8fb65cee25562a9e83d9 |
Hashes for symba-0.4.0-cp35-cp35m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9eac8de6e7346c811add895bea95505067387068210750d562627966f61cc04 |
|
MD5 | 6c6793589620d60af3a3c38363f4c1d9 |
|
BLAKE2b-256 | 4dfc7ac42c1a790462b89e22198d4b3f3b570f9eb19192779b6114024ee09d7b |
Hashes for symba-0.4.0-cp35-cp35m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1c6453ebf4db2f02fefc2938747829036d4b137382c89bcfb0e76e3e978b0a0 |
|
MD5 | 8af64764b09fd0fe4bf4c4650fcb45e8 |
|
BLAKE2b-256 | dc28740d6117485e789e5399c4000e7e39bdda23d00dc7241f5457146aa6d51a |