Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

symba-0.2.2.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

symba-0.2.2-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file symba-0.2.2.tar.gz.

File metadata

  • Download URL: symba-0.2.2.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.7.0 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.5.10

File hashes

Hashes for symba-0.2.2.tar.gz
Algorithm Hash digest
SHA256 22abab4d671b773aff9a0ef806d50288078c73aab258e0b0ce232a2ff2d2cf78
MD5 c6fe540bc474de59e5e8bfb3e0652169
BLAKE2b-256 ce8cb8058ca5844d9e70378879aa1a9d69098e4d9982b9ac47a2dc7ee112b3d5

See more details on using hashes here.

Provenance

File details

Details for the file symba-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: symba-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.7.0 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.5.10

File hashes

Hashes for symba-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3830a9dfd00d49c5c6f8f1865307c8ae65ab292737d65044d4c8dc6a5ad6c9dc
MD5 b7a700d2ba95edc8a441e11795d7707b
BLAKE2b-256 3f8dac72c16a52012716de9371a7a254004781b52f68cc61ae35a3ded75192f5

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page