Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to dev docs: pip upgrade, linting #130

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,19 @@ Please see the documentation of the `QuantToQCDQ` transformation to learn more a

## Development

Install in editable mode in a venv:
Install in editable mode in a Python virtual environment:

```
git clone https://github.com/fastmachinelearning/qonnx
cd qonnx
virtualenv -p python3.8 venv
source venv/bin/activate
pip install --upgrade pip
pip install -e .[qkeras,testing]
```

### Running tests

Run entire test suite, parallelized across CPU cores:
```
pytest -n auto --verbose
Expand All @@ -135,6 +138,22 @@ Run a particular test and fall into pdb if it fails:
pytest --pdb -k "test_extend_partition.py::test_extend_partition[extend_id1-2]"
```

### Linting

If you plan to make pull requests to the qonnx repo, linting will be required.
We use a pre-commit hook to auto-format Python code and check for issues. See https://pre-commit.com/ for installation. Once you have `pre-commit`,
you can install the hooks into your local clone of the qonnx repo:

```
cd qonnx
source venv/bin/activate
pip install pre-commit
pre-commit install
```

Every time you commit some code, the pre-commit hooks will first run, performing various checks and fixes. In some cases pre-commit won’t be able to
fix the issues and you may have to fix it manually, then run git commit once again. The checks are configured in .pre-commit-config.yaml under the repo root.

## Why QONNX?

The QONNX representation has several advantages compared to other alternatives, as summarized in the table below.
Expand Down
Loading