Skip to main content

Decision making problems.

Project description

decision

In what follows

  • python is an alias for python3.5 or any later version (python3.6 and so on),
  • pypy is an alias for pypy3.5 or any later version (pypy3.6 and so on).

Installation

Install the latest pip & setuptools packages versions:

  • with CPython
    python -m pip install --upgrade pip setuptools
    
  • with PyPy
    pypy -m pip install --upgrade pip setuptools
    

User

Download and install the latest stable version from PyPI repository:

  • with CPython
    python -m pip install --upgrade decision
    
  • with PyPy
    pypy -m pip install --upgrade decision
    

Developer

Download the latest version from GitHub repository

git clone https://github.com/lycantropos/decision.git
cd decision

Install dependencies:

  • with CPython
    python -m pip install --force-reinstall -r requirements.txt
    
  • with PyPy
    pypy -m pip install --force-reinstall -r requirements.txt
    

Install:

  • with CPython
    python setup.py install
    
  • with PyPy
    pypy setup.py install
    

Usage

>>> from decision.partition import coin_change
>>> list(coin_change(10, [2]))
[2, 2, 2, 2, 2]
>>> list(coin_change(10, [2, 3]))
[2, 2, 3, 3]
>>> list(coin_change(10, [2, 3, 4]))
[2, 4, 4]
>>> list(coin_change(10, [2, 3, 4, 5]))
[5, 5]

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:

  • with CPython
    python -m pip install --force-reinstall -r requirements-tests.txt
    
  • with PyPy
    pypy -m pip install --force-reinstall -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

decision-0.1.0a0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

decision-0.1.0a0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file decision-0.1.0a0.tar.gz.

File metadata

  • Download URL: decision-0.1.0a0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.5.6

File hashes

Hashes for decision-0.1.0a0.tar.gz
Algorithm Hash digest
SHA256 320273ce535ebe42524771d23202b23916fd632ea29bfdc5359eb04db1620dd2
MD5 414e751ecee9fa3eea955cac9ea77755
BLAKE2b-256 e7a05ec225efe9b6357e4dcf277b64c7ed74032e637a09825c2c69c7a6d1dbad

See more details on using hashes here.

Provenance

File details

Details for the file decision-0.1.0a0-py3-none-any.whl.

File metadata

  • Download URL: decision-0.1.0a0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.5.6

File hashes

Hashes for decision-0.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 75515734e4681ca5f22a3d4f96c237f48f648bc20e1eaff2e33298b2effc49c6
MD5 eb691bd70b5518ae0f14348a07c46b14
BLAKE2b-256 e1101b441f9646aa5c94de1e634d10d30ff37cdd5069df7197cd48ad0c52b551

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