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

Release v0.20.0 #732

Merged
merged 18 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ per-file-ignores =
tests/*: D100, D101, D102, D103
__init__.py: F401
pulser-core/pulser/backends.py: F401
pulser-core/pulser/math/__init__.py: D103
setup.py: D100
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.8", "3.12"]
with-torch: ["with-torch", "no-torch"]
steps:
- name: Check out Pulser
uses: actions/checkout@v4
Expand All @@ -67,9 +68,14 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
extra-packages: pytest
with-torch: ${{ matrix.with-torch }}
- name: Run the unit tests & generate coverage report
if: ${{ matrix.with-torch == 'with-torch' }}
run: pytest --cov --cov-fail-under=100
- name: Run the unit tests without torch installed
if: ${{ matrix.with-torch != 'with-torch' }}
run: pytest --cov
- name: Test validation with legacy jsonschema
run: |
pip install jsonschema==4.17.3
pytest tests/test_abstract_repr.py
pytest tests/test_abstract_repr.py -W ignore::DeprecationWarning
13 changes: 12 additions & 1 deletion .github/workflows/pulser-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ inputs:
description: Extra packages to install (give to grep)
required: false
default: ""
with-torch:
description: Whether to include pytorch
required: false
default: "with-torch"
runs:
using: "composite"
steps:
Expand All @@ -17,11 +21,18 @@ runs:
with:
python-version: ${{ inputs.python-version }}
cache: "pip"
- name: Install Pulser
- name: Install Pulser (with torch)
if: ${{ inputs.with-torch == 'with-torch' }}
shell: bash
run: |
python -m pip install --upgrade pip
make dev-install
- name: Install Pulser (without torch)
if: ${{ inputs.with-torch != 'with-torch' }}
shell: bash
run: |
python -m pip install --upgrade pip
make dev-install-no-torch
- name: Install extra packages from the dev requirements
if: "${{ inputs.extra-packages != '' }}"
shell: bash
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
# Python 3.8 and 3.9 does not run on macos-latest (14)
# Uses macos-13 for 3.8 and 3.9 and macos-latest for >=3.10
os: [ubuntu-latest, macos-13, macos-latest, windows-latest]
with-torch: ["with-torch", "no-torch"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
exclude:
- os: macos-latest
Expand All @@ -38,5 +39,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
extra-packages: pytest
with-torch: ${{ matrix.with-torch }}
- name: Run the unit tests & generate coverage report
run: pytest --cov --cov-fail-under=100
run: pytest --cov
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ dist/
env*
*.egg-info/
__venv__/
venv
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
.PHONY: dev-install
dev-install: dev-install-core dev-install-simulation dev-install-pasqal

.PHONY: dev-install-no-torch
dev-install-no-torch: dev-install-core-no-torch dev-install-simulation dev-install-pasqal

.PHONY: dev-install-core
dev-install-core:
pip install -e ./pulser-core[torch]

.PHONY: dev-install-core-no-torch
dev-install-core-no-torch:
pip install -e ./pulser-core

.PHONY: dev-install-simulation
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,24 @@ If you wish to install only the core ``pulser`` features, you can instead run:
pip install pulser-core
```

### Including PyTorch

To include PyTorch in your installation, append the ``[torch]`` suffix to the commands outlined above, i.e.

```bash
pip install pulser[torch]
```

for the standard ``pulser`` distribution with PyTorch, **or**

```bash
pip install pulser-core[torch]
```

for just the core features plus PyTorch support.

### Development install

If you wish to **install the development version of Pulser from source** instead, do the following from within this repository after cloning it:

```bash
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.19.0
0.20.0
5 changes: 1 addition & 4 deletions pulser-core/pulser/backend/qpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ def run(
self.validate_job_params(
job_params or [], self._sequence.device.max_runs
)
results = self._connection.submit(
self._sequence, job_params=job_params, wait=wait
)
return cast(RemoteResults, results)
return cast(RemoteResults, super().run(job_params, wait))

@staticmethod
def validate_job_params(
Expand Down
Loading