Skip to content

Commit

Permalink
Merge branch 'main' into gv/readout_errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gvelikova committed Oct 10, 2023
2 parents cd7c9ba + e95569c commit c80efac
Show file tree
Hide file tree
Showing 111 changed files with 6,843 additions and 420 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint and type check Qadence.
name: linting and type check

on:
push:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/test_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ jobs:
test_qadence_ubuntu:
name: Test Qadence (ubuntu)
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.9", "3.10"]
steps:
- uses: actions/checkout@v4
- name: Select Python 3.10
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: ${{ matrix.python-version }}
- name: Install Hatch
run: |
pip install hatch
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/test_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ on:
pull_request:
branches:
- main
paths:
- docs
workflow_dispatch: {}

concurrency:
Expand All @@ -17,11 +15,11 @@ concurrency:

jobs:
test_qadence_ubuntu:
name: Test Qadence (ubuntu)
name: Test Qadence docs (ubuntu)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Select Python 3.10
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Qadence example tests.
name: Run Qadence example and notebook tests.

on:
push:
Expand All @@ -9,8 +9,10 @@ on:
- main
paths:
- examples
paths-ignore:
- examples/notebooks
- notebooks
schedule:
# 03:00 every Saturday morning
- cron: '0 3 * * 6'
workflow_dispatch: {}

concurrency:
Expand All @@ -33,3 +35,6 @@ jobs:
- name: Run example tests
run: |
hatch -v run test-examples
- name: Run notebooks tests
run: |
hatch -v run test-notebooks
9 changes: 6 additions & 3 deletions .github/workflows/test_fast.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Qadence fast tests.
name: fast tests

on:
push:
Expand All @@ -17,12 +17,15 @@ jobs:
test_qadence_ubuntu:
name: Test Qadence (ubuntu)
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.9", "3.10"]
steps:
- uses: actions/checkout@v4
- name: Select Python 3.10
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: ${{ matrix.python-version }}
- name: Install Hatch
run: |
pip install hatch
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/test_notebooks.yml

This file was deleted.

22 changes: 19 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,28 @@ runs/
# Mkdocs
site/

# converted notebooks
docs/**/*.py

# pt files
*.pt

# event files
events.out.tfevents.*
/examples/notebooks/onboarding_sandbox.ipynb

# latex
*.aux
*.lof
*.log
*.lot
*.fls
*.out
*.toc
*.fmt
*.fot
*.cb
*.cb2
*.lb
*.pdf
*.ps
*.dvi

*.gv
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ repos:
args: ['--maxkb=600']

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.288"
rev: "v0.0.291"
hooks:
- id: ruff
args: [--fix, --show-fixes, --show-source]
args: [--fix, --show-fixes, --show-source, --exclude, examples/draw.py]

- repo: https://github.com/ambv/black
rev: 23.7.0
rev: 23.9.1
hooks:
- id: black

Expand Down
33 changes: 33 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
90 changes: 90 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# How to contribute

We're grateful for your interest in participating in Qadence. Please follow our guidelines to ensure a smooth contribution process.

## Reporting an issue or proposing a feature

Your course of action will depend on your objective, but generally, you should start by creating an issue. If you've discovered a bug or have a feature you'd like to see added to **qadence**, feel free to create an issue on [qadence's GitHub issue tracker](https://github.com/pasqal-io/qadence/issues). Here are some steps to take:

1. Quickly search the existing issues using relevant keywords to ensure your issue hasn't been addressed already.
2. If your issue is not listed, create a new one. Try to be as detailed and clear as possible in your description.

- If you're merely suggesting an improvement or reporting a bug, that's already excellent! We thank you for it. Your issue will be listed and, hopefully, addressed at some point.
- However, if you're willing to be the one solving the issue, that would be even better! In such instances, you would proceed by preparing a [Pull Request](#submitting-a-pull-request).

## Submitting a pull request

We're excited that you're eager to contribute to Qadence. To contribute, fork the `main` branch of qadence repository and once you are satisfied with your feature and all the tests pass create a [Pull Request](https://github.com/pasqal-io/qadence/pulls).

Here's the process for making a contribution:

Click the "Fork" button at the upper right corner of the [repo page](https://github.com/pasqal-io/qadence) to create a new GitHub repo at `https://github.com/USERNAME/qadence`, where `USERNAME` is your GitHub ID. Then, `cd` into the directory where you want to place your new fork and clone it:

```shell
git clone https://github.com/USERNAME/qadence.git
```

Next, navigate to your new qadence fork directory and mark the main qadence repository as the `upstream`:

```shell
git remote add upstream https://github.com/pasqal-io/qadence.git
```

## Setting up your development environment

We recommended to use `hatch` for managing environments:

To develop within qadence, use:
```shell
pip install hatch
hatch -v shell
```

To run qadence tests, use:

```shell
hatch -e tests run test
```

If you don't want to use `hatch`, you can use the environment manager of your
choice (e.g. Conda) and execute the following:

```shell
pip install pytest
pip install -e .
pytest
```

### Useful things for your workflow: linting and testing

Use `pre-commit` to lint your code and run the unit tests before pushing a new commit.

Using `hatch`, it's simply:

```shell
hatch -e tests run pre-commit run --all-files
hatch -e tests run test
```

Our CI/CD pipeline will also test if the documentation can be built correctly. To test it locally, please run:

```shell
hatch -e docs run mkdocs build --clean --strict
```

Without `hatch`, `pip` install those libraries first:
"mkdocs",
"mkdocs-material",
"mkdocstrings",
"mkdocstrings-python",
"mkdocs-section-index",
"mkdocs-jupyter",
"mkdocs-exclude",
"markdown-exec"


And then:

```shell
mkdocs build --clean --strict
```
Loading

0 comments on commit c80efac

Please sign in to comment.