Skip to content

Commit

Permalink
change: nobraket branch (#29)
Browse files Browse the repository at this point in the history
* change: nobraket branch

* change: Remove threading tests thanks to new pythoncall version

* fix: make tests compatible with xdist

* fix: Use proper BraketSimulator.jl version

* Use a `ProcessPoolExecutor` to talk to Julia (#30)

* fix: Use new BraketSimulator.jl version

* fix: Force a Julia registry update in CI to catch new versions

* update tests (#31)

* update tests

* add a test optimization

* refactor pyproject file to have test dependencies in their own file

* Update requirements-test.txt

* Update requirements-test.txt

---------

Co-authored-by: Coull <[email protected]>

* Fixes for speedier Python-Julia interaction (#32)

* change: Use multiprocessing Pool rather than ProcessPoolExecutor

* fix: No sigterm screaming

* fix: Force close and join at exit

* fix: Faster

* fix: handle julia error in serializable way

* change: Add benchmark workflow to CI

* change: Point to latest unblocking branch

* fix: linting

* fix: Don't turn off juliapkg in tox

* Update src/braket/simulator_v2/julia_workers.py

Co-authored-by: Ryan Shaffer <[email protected]>

* Update src/braket/simulator_v2/julia_workers.py

Co-authored-by: Ryan Shaffer <[email protected]>

* fix: one-line pip in benchmark

* fix: typo

* fix: Use benchmark-json option correctly

* change: Add initial output.json

* fix: Actually include benchmark script

* fix: Don't deploy benchmark results to gh-pages

* fix: restore GH token

* fix: Remove benchmarks for now

* change: Point to new BraketSimulator 0.0.4

---------

Co-authored-by: Ryan Shaffer <[email protected]>

* fix: Don't turn off pyjuliapkg to make sure dpes do install

* fix: Don't return the julia Main module to unlock jupyter

* fix: Return to not using JuliaError type in case Julia isn't loaded

---------

Co-authored-by: Coull <[email protected]>
Co-authored-by: Abe Coull <[email protected]>
Co-authored-by: Ryan Shaffer <[email protected]>
  • Loading branch information
4 people authored Aug 28, 2024
1 parent 90d69d2 commit dc99e0a
Show file tree
Hide file tree
Showing 17 changed files with 434 additions and 1,339 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,33 @@ on:
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
# don't run all the jobs at once to avoid wasting CI
max-parallel: 2
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Install juliaup
uses: julia-actions/install-juliaup@v2
with:
channel: '1'
- name: Update Julia registry
shell: julia --project=. --color=yes {0}
run: |
using Pkg
Pkg.Registry.update()
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Get Python Simulator
uses: actions/checkout@v4
with:
path: python_sim
- name: Install dependencies
run: |
pip install tox
- name: Run Tests
run: |
cd python_sim
tox -e unit-tests
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4
Expand Down
23 changes: 2 additions & 21 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,19 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Operating System :: OS Independent"
]
dynamic = ["version", "dependencies"]
dynamic = ["version", "dependencies", "optional-dependencies"]

[project.entry-points."braket.simulators"]
braket_sv_v2 = "braket.simulator_v2.state_vector_simulator_v2:StateVectorSimulatorV2"
braket_dm_v2 = "braket.simulator_v2.density_matrix_simulator_v2:DensityMatrixSimulatorV2"

[project.optional-dependencies]
test = [
"amazon-braket-pennylane-plugin",
"black",
"flake8",
"flake8-rst-docstrings",
"isort",
"pre-commit",
"pylint",
"pytest==7.1.2",
"pytest-benchmark",
"pytest-cov",
"pytest-rerunfailures",
"pytest-xdist",
"sphinx",
"sphinx-rtd-theme",
"sphinxcontrib-apidoc",
"tox"
]

[tool.setuptools]
include-package-data=false
package-data = {"*" = ["*.json"]}

[tool.setuptools.dynamic]
dependencies = {file = "requirements.txt"}
optional-dependencies.test = { file = "requirements-test.txt" }

[tool.isort]
profile = "black"
20 changes: 20 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
amazon-braket-pennylane-plugin
black
flake8
flake8-rst-docstrings
isort
pre-commit
pylint
pytest==7.1.2
pytest-benchmark
pytest-cov
pytest-rerunfailures
pytest-timeout
pytest-xdist
qiskit==1.2.0
qiskit-braket-provider==0.4.1
qiskit-algorithms
sphinx
sphinx-rtd-theme
sphinxcontrib-apidoc
tox
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
juliacall==0.9.20
juliacall==0.9.22
numpy
amazon-braket-schemas>=1.20.2
amazon-braket-sdk>=1.83.0
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ test=pytest
[tool:pytest]
xfail_strict = true
addopts =
--verbose
--verbose -n auto --durations=0 --durations-min=1 --dist worksteal
testpaths = test/unit_tests

[flake8]
Expand Down
7 changes: 5 additions & 2 deletions src/braket/juliapkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
"packages": {
"BraketSimulator": {
"uuid": "76d27892-9a0b-406c-98e4-7c178e9b3dff",
"url": "https://github.com/amazon-braket/BraketSimulator.jl.git",
"rev": "main"
"version": "0.0.4"
},
"JSON3": {
"uuid": "0f8b85d8-7281-11e9-16c2-39a750bddbf1",
"version": "1.14.0"
}
}
}
1 change: 0 additions & 1 deletion src/braket/simulator_v2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from braket.simulator_v2.density_matrix_simulator_v2 import ( # noqa: F401
DensityMatrixSimulatorV2,
)
from braket.simulator_v2.julia_import import jl, jlBraketSimulator # noqa: F401
from braket.simulator_v2.state_vector_simulator_v2 import ( # noqa: F401
StateVectorSimulatorV2,
)
Expand Down
Loading

0 comments on commit dc99e0a

Please sign in to comment.