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.1.0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

symba-0.1.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: symba-0.1.0.tar.gz
  • Upload date:
  • Size: 10.1 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.1.0.tar.gz
Algorithm Hash digest
SHA256 ca9fdd7bdd10f123013cbe8b9aa866e30c242c29a35ca174629537a5be067a52
MD5 673ac4bdf263c3041bb0a0e4fbabf8a4
BLAKE2b-256 5c65ad0543154d562801661b29cc380f17d2ec171f0d586580f24f4024ec6d81

See more details on using hashes here.

File details

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

File metadata

  • Download URL: symba-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.8 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e011ffd038c1c787aaa1a01eaf3c3888541f47606be2d966c8e1524d05e24727
MD5 6520103af188335715b554f7ecab4d02
BLAKE2b-256 efe1fed9119008f0825d07326e019f2187bf931e405494c7781e30b8abd8b536

See more details on using hashes here.

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