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.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fcd6a75b9d4e798530a2ce471afacac384020c5ce4e76ac46a5d5dfaf7a6bd1 |
|
MD5 | 1d7b9104dee46b922e36d9570928b8a2 |
|
BLAKE2b-256 | 72181f84091083261b292fde858fa873860d56dbb058c6cd83183e170135234e |
Hashes for symba-0.4.1-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31859e40f4e24e4fe1e0b75aba51cc5d74674cc72584ba39ce3fe1655ab7d26b |
|
MD5 | a8f3efe74b08cc229bae970d1e908944 |
|
BLAKE2b-256 | e1f1e02d5af914b5036508fb49cf7be3aab4e62242625340110137311e737d42 |
Hashes for symba-0.4.1-cp39-cp39-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91d4a8f43507612b0b7c1f9491bdc0bebeec391ced2d8db1771923d4e311a763 |
|
MD5 | 98162a3852d5e64901794d9b96bb549c |
|
BLAKE2b-256 | 01c1be2fb84293fd32062c614bebb63b595241f25ba104271f96b2a063b73017 |
Hashes for symba-0.4.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8edd82811749add0f09987e6ed50d1ff8ea73aa78917821ca00cce0e1aba663e |
|
MD5 | 7b1642b7a17163891c0a6fe170583345 |
|
BLAKE2b-256 | 9ddfd7144ffa509a1cd5038d61a9fa71420a2f71bc69228e8f4a58eda1367aa9 |
Hashes for symba-0.4.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a10adc1b39d0eb7cfa7575807ef67cf57046221b8abd96ce8add3b353d19215c |
|
MD5 | eee1e5b32290452dba3a272fd755087e |
|
BLAKE2b-256 | fda5cb0e03cc22df1d89a3d36e4ace55ef622693bd0acd5b2565ee5c564c2c02 |
Hashes for symba-0.4.1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9c65027bacad4fd02b8be464d8722bb4a3c49c4edf2d61c5ee266b769087151 |
|
MD5 | c3828d4b8108ceddded7f85665e86acc |
|
BLAKE2b-256 | 024feb8fe51bd208274c47c9968407ccc7f9acb170b4db66989d9029d002ae3e |
Hashes for symba-0.4.1-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40a26ba1f00c7bc1c8d2e2214e9e68527a17d92e9f496964843d69a41107fa37 |
|
MD5 | fb4369ed90defc15dc25d069f9276690 |
|
BLAKE2b-256 | 47278b6e7aa6e9562a61a2302a147fe1d53cb565a672c14975d85c6678bba459 |
Hashes for symba-0.4.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffa47f98f0c4cddc420b221cc64c0772b08585573215a9eb36c9476018e45564 |
|
MD5 | 116fc84437a4e12eb79713e69a5cb0c8 |
|
BLAKE2b-256 | 89f6e87430f3fef1a4a888d64dec01df7ae1dae7ead247b9a2c5232a4d1bb4a6 |
Hashes for symba-0.4.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ceff7ee3c2410f2e86867af9e86ecc768dba63a75b17e1edca3eee68dc090a2 |
|
MD5 | 7555402beafb0000a8fae7412994d205 |
|
BLAKE2b-256 | bc44ca26d8730b3d9c35e7f9cee52d4abe2c052da96404f3af57a074397872de |
Hashes for symba-0.4.1-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf678b33c14dde7a65a5be623fbbcb0fc06b069faeaa92a1a94536a8b6549b15 |
|
MD5 | 9bf3b78ea8165f8bf4da7a884f0e7188 |
|
BLAKE2b-256 | 0bbaec4579007c96325d7c2cff20aa52adf42e827d7621e36740729b6f486d67 |
Hashes for symba-0.4.1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 055d058098ff75b38e12a55e97a08297a86e87615da70ec7f7316ca03c25b46f |
|
MD5 | a1b9c0d3d898d844d203708141571ef6 |
|
BLAKE2b-256 | abd2bd00e1a4366fc245d0aec006036a040dcd6e5fbd8ec34f3d970e4dca76f0 |
Hashes for symba-0.4.1-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c623fbbdefcfb00d8a088a8acbc1eb79e5584845c40e0d761caaa2a009e4b703 |
|
MD5 | 05230abe417b5cb09b9b0184c0830dfe |
|
BLAKE2b-256 | 3245b74af2b063d49925600a997b1b93ec13f5ad949b065e9a2f8114416e2929 |
Hashes for symba-0.4.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29c1bc46e19219998381049210e0d7d8db22ac99d3d3f075bbeafe73781c5de2 |
|
MD5 | ac39de16956237faa6adde28e8b09ed5 |
|
BLAKE2b-256 | f9a16c19d1973ad0fae21f21f1b5e3648f01c703f89c0d96b494f90552edbb36 |
Hashes for symba-0.4.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d1e2fd549bb2e55bcd837159572c9dbe9797c254cdc6e2cd6c3be4fd19301cd |
|
MD5 | 9ccaf1e62e421453afb641b71d2e44d5 |
|
BLAKE2b-256 | 40cf5fa002acb94282be669d5f0f01d03e1c4f28e8b32689f83c26c4d4ae1362 |
Hashes for symba-0.4.1-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62c30abad4aee1c45c91f9feebeac2021894cad5591b1bbe8bddd8eaf714a488 |
|
MD5 | e4ac0651c37b911115006c6d0f7eee20 |
|
BLAKE2b-256 | 91cfe6ce857f990641cc47abe6157cf1344c73fc885a31c56bd24d89d470f6be |
Hashes for symba-0.4.1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0303f39f8db827f4c2fa6bb354c867107b5b0a0c1ac101ef0accb2c5d4c21b88 |
|
MD5 | b55626411fadd45811e884370af4eacb |
|
BLAKE2b-256 | f16acb9e07f1151d2842a173cb737e7d151b923d8d272ed9fb25f50d7a4ed325 |
Hashes for symba-0.4.1-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef740234aa0b2adc9b367666aee009411b4a9e9688c251c41bdc381edd2e7839 |
|
MD5 | 1d81e8e5760829613ca5f68914954281 |
|
BLAKE2b-256 | c6e1246f65f10ca3be49b5390e3580d8183edecf3d456eb2bb2f88ebd0b5043f |
Hashes for symba-0.4.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcf3d3d743275c1f459f87f08a7197b2ee489a442010dbd723eb1a7654420d15 |
|
MD5 | da8312bc0d3b71691f60a14e5321ec74 |
|
BLAKE2b-256 | 33f4e519b02784d8ec311ad48129ae9e2f43065dd2ebc84f95ef43cc3db3bd33 |
Hashes for symba-0.4.1-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 823306040bbba27c2f8324e4d6d860946d2077772fe952334c2d1040bd043bdc |
|
MD5 | e7bf01b707df14b04038aab638dc6e7f |
|
BLAKE2b-256 | d5d3b712cc188214f6bff6b6dacf6572db1ee87f53f4ae1081e5f1573e9d294a |
Hashes for symba-0.4.1-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 572f8d49df5a07bafdb1c31e64574af462ac86478b692858102ad3ccc656b616 |
|
MD5 | 6872f528093cfd17a2a8f0bee0391184 |
|
BLAKE2b-256 | 7ffb297cdb806453510af890262059ef1895dd249f703c478c3a9a715bfe905b |
Hashes for symba-0.4.1-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d00c12c17004cc53c2451f2be0490bbd49d1de6b0e756902fdae643e0a7b3c1 |
|
MD5 | f97c6754663917a550548fb63769d698 |
|
BLAKE2b-256 | 2157075b57f30888d349680a77e928a219c97cd016a8e06dec984704b95ae5c2 |
Hashes for symba-0.4.1-cp35-cp35m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe1b07f992e8aa7bde9c1b8c45bbd185a146a9429d2e45416443010b508296e7 |
|
MD5 | 173b6e72d53ab7b90e914cc3f03b18da |
|
BLAKE2b-256 | 7e235695d913d3a06e323eb49c6648904b3332f62ad245f7d0bce28c93ea0ae3 |
Hashes for symba-0.4.1-cp35-cp35m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 543ade0d3e81d4b8f1c1ec9129500de1e68ded485f0a130e4ad005adcc96f0d5 |
|
MD5 | 8e3ceccc9b68457f6ef20769862ba584 |
|
BLAKE2b-256 | fb0bff831dc9614e5c4d5c8e02de9bd89635c3c21fae962ff6692bc9bd236206 |