Skip to main content

bashi

codecov

A library to provide a job generator for CI's for alpaka based projects.

The library provides everything needed to generate a sparse combination matrix for alpaka-based projects, including a set of general-purpose combination rules.

The main function of the library is generate_combination_list(). It takes a list of parameter-values, creates the combination-list, applies the combination filter rules, thins it out and returns the sparse combination-list.

The thinning is done according to the principle all-pairs testing. The principle means that every combination of the parameter-values of at least two parameters must be part of a combination, unless a filter rule forbids this.

The provision of the input parameters-values, adding custom filter rules, the reordering of the jobs, the filtering of the combination-list and the generation of the job yaml are project specific. Therefore, the library provides an example of how most parts can be implemented.

Naming

The main component of the bashi library is combinatorics. Due to the wide spread of the field, there are different words for the same things. Therefore, bashi has introduced a naming guideline that is used for function and parameter names and documentation. Please read the naming guidelines.

Example

An example of the use of the bashi library can be found in example/example.py. It shows how to use the library to create a combination-list from a parameter-value-matrix. The example also uses a custom filter. For more details, please read the module documentation of example/example.py.

Installation

Install via pip:

pip install bashi-ci

See pypi.org

bashi-validate

bashi-validate is a tool which is installed together with the bashi library. The tool allows to check whether a combination of parameters passes the different filters and displays the reason if not.

bashi-validate example

Hint: The source code of the tool is located in the file validate.py.

Developing

It is strongly recommended to use a Python environment for developing the code, such as virtualenv or a conda environment. The following code uses a virtualenv.

  1. Create the environment: virtualenv -p python3 env
  2. Activate the environment: source env/bin/activate
  3. Install the library: pip install --editable .
  4. Test the installation with the example: python3 example/example.py
  5. You can run the unit tests by going to the test directory and running python -m unittest discover -s tests -p "*.py"

If the example works correctly, a job.yml will be created in the current directory. You can also run python3 example/example.py --help to see additional options.

Now the library is available in the environment. Therefore you can easily use the library in your own projects via import bashi.

Contribution

This section contains some hints for developing new functions. The hints are mainly for people who have no experience with setuptools and building pip packages.

  • The pip install --editable . command installs the source code files as a symbolic link. This means that changes in the source code of the Python files in the src/bashi folder are directly available without any additional installation step (only a restart of the Python process/interpreter is required).
  • The software requirements are defined in pyproject.toml and not in an additional requirements.txt.
  • It is necessary to increase the version number in version.txt before a new feature can be merged in the master branch. Otherwise the upload to pypy.org will fail because existing versions cannot be changed.

Writing a new Filter rule

Writing a new filter rule can be complicated. That's why we offer a best practice guide.

Removing expected parameter-values

bashi offers the option of checking the generated combination-list for expected and unexpected parameter-value-pairs. To do this, bashi first generates all possible parameter-value-pairs from the input parameter-values and then removes unexpected parameter-values. bashi supports common cases of removing parameter-value-pairs with some util functions. Read the guide for removing parameter-value-pairs for more information about util functions.

Formatting the Source Code

The source code is formatted using the black formatter and the default style guide. You must install it and run black /path/to/file to format a file. A CI job checks that all files are formatted correctly. If the job fails, a PR cannot be merged.

Check Code Coverage locally

The project supports code coverage with coverage.py. To create a coverage report locally, you must first install the package via pip install coverage. Then run coverage run in the project folder to calculate the coverage and coverage report to display the result.

What is a Bashi?

Bashi is short for caravan bashi, which is the English translation of the Turkish word kervanbaşı/karavanbaşı, head of the caravan.

Download files

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

Source Distribution

bashi_ci-1.0.2.tar.gz (88.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bashi_ci-1.0.2-py3-none-any.whl (67.8 kB view details)

Uploaded Python 3

File details

Details for the file bashi_ci-1.0.2.tar.gz.

File metadata

  • Download URL: bashi_ci-1.0.2.tar.gz
  • Upload date:
  • Size: 88.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for bashi_ci-1.0.2.tar.gz
Algorithm Hash digest
SHA256 2020c7f53f0c3b44d77d0b4c10d974a65d6b6036f6b7528d62629432fe5104b3
MD5 b35b31f3f6cc5d712a093e0b437ad137
BLAKE2b-256 a179dc557e786d5309bb54aece80d03027845c8a74091f9b9ef769c37a39e2e1

See more details on using hashes here.

File details

Details for the file bashi_ci-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: bashi_ci-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 67.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for bashi_ci-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b61024e5ef680359b09637c2929e40ba8a7e5277ffac7e62f44ed8360ecaa735
MD5 dbcea372704813018fda7594f10d47a8
BLAKE2b-256 dafb96e5d1b70cfdc5eda325afec0c81e09cade359253fc24145bf5304b6db5a

See more details on using hashes here.

Release history Release notifications | RSS feed

1.1.0

2 files

This release

1.0.2 This release

2 files

1.0.1

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page