Newer
Older
<img src="logos/logo.png" width="278" height="100">
B-ASIC is an ASIC toolbox for Python 3 that simplifies circuit design and optimization.
The latest documentation can be viewed at: https://da.gitlab-pages.liu.se/B-ASIC/index.html
How to build and debug the library during development.
### Prerequisites
The following packages are required in order to build the library:
- [Python](https://python.org/) 3.10+
- Python dependencies (install with `pip install .` or they will be installed as part of the
installation process):
- [Graphviz](https://graphviz.org/)
- [Matplotlib](https://matplotlib.org/)
- [NumPy](https://numpy.org/)
- [QtPy](https://github.com/spyder-ide/qtpy)
- [setuptools_scm](https://github.com/pypa/setuptools_scm/)
- [NetworkX](https://networkx.org/)
- [QtAwesome](https://github.com/spyder-ide/qtawesome/)
- Qt 6, with Python bindings, one of: (install with `pip install .[$BINDING_NAME]`)
Angus Lothian
committed
To build a binary distribution, the following additional packages are required:
Angus Lothian
committed
To run the test suite, the following additional packages are required:
- Python (install with `pip install .[test]`):
- [pytest](https://pytest.org/)
- [pytest-qt](https://pytest-qt.readthedocs.io/)
- [pytest-mpl](https://github.com/matplotlib/pytest-mpl/)
- [pytest-cov](https://pytest-cov.readthedocs.io/en/latest/) (for testing with coverage)
- [pytest-xvfb](https://github.com/The-Compiler/pytest-xvfb) (for testing without showing windows on Linux, you will also need to install [xvfb](https://www.x.org/releases/X11R7.6/doc/man/man1/Xvfb.1.xhtml))
- [pytest-xdist](https://pytest-xdist.readthedocs.io/) (for parallel testing)
Angus Lothian
committed
To generate the documentation, the following additional packages are required:
- Python (install with `pip install .[doc]`):
- [Sphinx](https://www.sphinx-doc.org/)
- [Furo](https://pradyunsg.me/furo/)
- [numpydoc](https://numpydoc.readthedocs.io/)
- [Sphinx-Gallery](https://sphinx-gallery.github.io/)
- [mplsignal](https://mplsignal.readthedocs.io/)
- [sphinx-copybutton](https://sphinx-copybutton.readthedocs.io/)
How to create a package using setuptools that can be installed using pip.
#### Setup (Binary distribution)
The output gets written to `B-ASIC/dist/b_asic-<version>-<python_tag>-<abi_tag>-<platform_tag>.whl`.
#### Setup (Source distribution)
The output gets written to `B-ASIC/dist/b-asic-<version>.tar.gz`.
#### Installation (Binary distribution)
pip install b_asic-<version>-<python_tag>-<abi_tag>-<platform_tag>.whl
```
#### Installation (Source distribution)
pip install b-asic-<version>.tar.gz
```
### Running tests
How to run the tests using pytest in a virtual environment.
#### Linux/OS X
python3 -m venv env
source env/bin/activate
pip install .[test]
python3 -m venv env
.\env\Scripts\activate.bat
pip install .[test]
pytest
```
#### Test with coverage
pytest --cov=b_asic --cov-report=html test
```
#### Generate new baseline images for the tests
In `B-ASIC`:
pytest # The image comparison tests will fail
cp -a result_images/* test/baseline_images/
Angus Lothian
committed
### Generating documentation
sphinx-build -b html docs_sphinx docs_sphinx/_build
```
Angus Lothian
committed
```
The output gets written to `B-ASIC/docs_sphinx/_build`.
Angus Lothian
committed
How to build and use the library as a user.
### Installation
pip install .[pyqt6]
```
or
```bash
pip install .[pyside6]
python3
>>> import b_asic as asic
>>> help(asic)
```
## License
B-ASIC is distributed under the MIT license.
See the included LICENSE file for more information.