bloqade-core 0.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. bloqade_core-0.6.0/.github/dependabot.yml +7 -0
  2. bloqade_core-0.6.0/.github/workflows/ci.yml +73 -0
  3. bloqade_core-0.6.0/.github/workflows/devdoc.yml +48 -0
  4. bloqade_core-0.6.0/.github/workflows/doc.yml +44 -0
  5. bloqade_core-0.6.0/.github/workflows/lint.yml +45 -0
  6. bloqade_core-0.6.0/.github/workflows/pub_doc.yml +53 -0
  7. bloqade_core-0.6.0/.github/workflows/release.yml +90 -0
  8. bloqade_core-0.6.0/.gitignore +163 -0
  9. bloqade_core-0.6.0/.pre-commit-config.yaml +38 -0
  10. bloqade_core-0.6.0/LICENSE +201 -0
  11. bloqade_core-0.6.0/PKG-INFO +34 -0
  12. bloqade_core-0.6.0/README.md +24 -0
  13. bloqade_core-0.6.0/docs/contrib.md +69 -0
  14. bloqade_core-0.6.0/docs/index.md +23 -0
  15. bloqade_core-0.6.0/docs/install.md +44 -0
  16. bloqade_core-0.6.0/docs/scripts/gen_ref_nav.py +51 -0
  17. bloqade_core-0.6.0/docs/stylesheets/extra.css +34 -0
  18. bloqade_core-0.6.0/justfile +26 -0
  19. bloqade_core-0.6.0/mkdocs.yml +129 -0
  20. bloqade_core-0.6.0/pyproject.toml +101 -0
  21. bloqade_core-0.6.0/src/bloqade/geometry/__init__.py +7 -0
  22. bloqade_core-0.6.0/src/bloqade/geometry/dialects/__init__.py +0 -0
  23. bloqade_core-0.6.0/src/bloqade/geometry/dialects/filled/__init__.py +9 -0
  24. bloqade_core-0.6.0/src/bloqade/geometry/dialects/filled/_dialect.py +3 -0
  25. bloqade_core-0.6.0/src/bloqade/geometry/dialects/filled/_interface.py +62 -0
  26. bloqade_core-0.6.0/src/bloqade/geometry/dialects/filled/concrete.py +43 -0
  27. bloqade_core-0.6.0/src/bloqade/geometry/dialects/filled/stmts.py +43 -0
  28. bloqade_core-0.6.0/src/bloqade/geometry/dialects/filled/types.py +170 -0
  29. bloqade_core-0.6.0/src/bloqade/geometry/dialects/grid/__init__.py +39 -0
  30. bloqade_core-0.6.0/src/bloqade/geometry/dialects/grid/_dialect.py +3 -0
  31. bloqade_core-0.6.0/src/bloqade/geometry/dialects/grid/_interface.py +309 -0
  32. bloqade_core-0.6.0/src/bloqade/geometry/dialects/grid/_typeinfer.py +66 -0
  33. bloqade_core-0.6.0/src/bloqade/geometry/dialects/grid/concrete.py +240 -0
  34. bloqade_core-0.6.0/src/bloqade/geometry/dialects/grid/stmts.py +216 -0
  35. bloqade_core-0.6.0/src/bloqade/geometry/dialects/grid/types.py +643 -0
  36. bloqade_core-0.6.0/src/bloqade/geometry/prelude.py +48 -0
  37. bloqade_core-0.6.0/src/bloqade/geometry/rewrite/__init__.py +0 -0
  38. bloqade_core-0.6.0/src/bloqade/geometry/rewrite/desugar.py +0 -0
  39. bloqade_core-0.6.0/test/__init__.py +0 -0
  40. bloqade_core-0.6.0/test/filled/__init__.py +0 -0
  41. bloqade_core-0.6.0/test/filled/test_api.py +177 -0
  42. bloqade_core-0.6.0/test/grid/test_concrete.py +101 -0
  43. bloqade_core-0.6.0/test/grid/test_typeinfer.py +62 -0
  44. bloqade_core-0.6.0/test/grid/test_types.py +329 -0
  45. bloqade_core-0.6.0/test/test_kernel_interp.py +67 -0
  46. bloqade_core-0.6.0/test/test_serialization.py +53 -0
  47. bloqade_core-0.6.0/uv.lock +1893 -0
@@ -0,0 +1,7 @@
1
+ version: 2
2
+ updates:
3
+ # Maintain dependencies for GitHub Actions
4
+ - package-ecosystem: "github-actions"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
@@ -0,0 +1,73 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - main
8
+ schedule:
9
+ - cron: '00 01 * * *'
10
+ concurrency:
11
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12
+ cancel-in-progress: true
13
+
14
+ jobs:
15
+ build:
16
+ runs-on: ubuntu-latest
17
+ strategy:
18
+ matrix:
19
+ python-version: ["3.10", "3.11", "3.12"]
20
+
21
+ steps:
22
+ - uses: actions/checkout@v6
23
+ - name: Install uv
24
+ uses: astral-sh/setup-uv@v7
25
+ with:
26
+ # Install a specific version of uv.
27
+ version: "0.5.1"
28
+ enable-cache: true
29
+ cache-dependency-glob: "uv.lock"
30
+ - name: Set up Python ${{ matrix.python-version }}
31
+ run: uv python install ${{ matrix.python-version }}
32
+ - name: Install the project
33
+ run: uv sync --all-extras --dev
34
+ - name: Run tests
35
+ # For example, using `pytest`
36
+ run: uv run just coverage
37
+ - name: Upload Coverage to Codecov
38
+ uses: codecov/codecov-action@v6
39
+ with:
40
+ files: coverage.xml # optional
41
+ fail_ci_if_error: true # optional (default = false)
42
+ verbose: true # optional (default = false)
43
+ token: ${{ secrets.CODECOV_TOKEN }} # required
44
+ - name: Archive code coverage results
45
+ if: matrix.python-version == '3.12'
46
+ uses: actions/upload-artifact@v7
47
+ with:
48
+ name: code-coverage-report
49
+ path: coverage.xml
50
+ retention-days: 2
51
+ post:
52
+ runs-on: ubuntu-latest
53
+ needs: build
54
+ if: github.event.pull_request
55
+ steps:
56
+ - uses: actions/checkout@v6
57
+ - name: download coverage
58
+ uses: actions/download-artifact@v8
59
+ with:
60
+ name: code-coverage-report
61
+ - name: check coverage
62
+ run: |
63
+ if [ -f coverage.xml ]; then
64
+ echo "Coverage file exists"
65
+ else
66
+ echo "Coverage file does not exist"
67
+ exit 1
68
+ fi
69
+ - name: post coverage
70
+ uses: orgoro/coverage@v3.3
71
+ with:
72
+ coverageFile: coverage.xml
73
+ token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,48 @@
1
+ name: Deploy Devopment Branch Docs
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+
7
+ concurrency:
8
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9
+ cancel-in-progress: true
10
+
11
+ jobs:
12
+ documentation:
13
+ name: Deploy dev documentation
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v6
17
+ with:
18
+ fetch-depth: 0
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v7
21
+ with:
22
+ # Install a specific version of uv.
23
+ version: "0.5.1"
24
+ enable-cache: true
25
+ cache-dependency-glob: "uv.lock"
26
+ - name: Install Documentation dependencies
27
+ run: uv sync --group doc
28
+ - name: Set up build cache
29
+ uses: actions/cache@v5
30
+ id: cache
31
+ with:
32
+ key: mkdocs-material-${{ github.ref }}
33
+ path: .cache
34
+ restore-keys: |
35
+ mkdocs-material-
36
+ # derived from:
37
+ # https://github.com/RemoteCloud/public-documentation/blob/dev/.github/workflows/build_docs.yml
38
+ - name: Configure Git user
39
+ run: |
40
+ git config --local user.email "github-actions[bot]@users.noreply.github.com"
41
+ git config --local user.name "github-actions[bot]"
42
+ - name: Deploy documentation
43
+ env:
44
+ GH_TOKEN: ${{ secrets.GH_TOKEN }}
45
+ GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
46
+ run: |
47
+ git fetch origin gh-pages --depth=1
48
+ uv run mike deploy -p dev
@@ -0,0 +1,44 @@
1
+ name: Documentation (preview)
2
+ on:
3
+ pull_request:
4
+ types:
5
+ - opened
6
+ - reopened
7
+ - synchronize
8
+ - closed
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ jobs:
14
+ documentation:
15
+ name: Deploy preview documentation
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v6
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v7
21
+ with:
22
+ # Install a specific version of uv.
23
+ version: "0.5.1"
24
+ enable-cache: true
25
+ cache-dependency-glob: "uv.lock"
26
+ - name: Install Documentation dependencies
27
+ run: uv sync --group doc
28
+ - name: Set up build cache
29
+ uses: actions/cache@v5
30
+ id: cache
31
+ with:
32
+ key: mkdocs-material-${{ github.ref }}
33
+ path: .cache
34
+ restore-keys: |
35
+ mkdocs-material-
36
+ - name: Deploy documentation
37
+ env:
38
+ GH_TOKEN: ${{ secrets.GH_TOKEN }}
39
+ run: |
40
+ uv run mkdocs build
41
+ - name: Deploy preview
42
+ uses: rossjrw/pr-preview-action@v1
43
+ with:
44
+ source-dir: ./site
@@ -0,0 +1,45 @@
1
+ name: Lint
2
+ on:
3
+ pull_request:
4
+ push:
5
+ branches:
6
+ - main
7
+ concurrency:
8
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9
+ cancel-in-progress: true
10
+
11
+ jobs:
12
+ isort:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v6
16
+ - uses: isort/isort-action@v1
17
+ with:
18
+ sortPaths: "src" # only sort files in the src directory
19
+ ruff:
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v6
23
+ - uses: chartboost/ruff-action@v1
24
+ black:
25
+ runs-on: ubuntu-latest
26
+ steps:
27
+ - uses: actions/checkout@v6
28
+ - uses: psf/black@stable
29
+ pyright:
30
+ runs-on: ubuntu-latest
31
+ steps:
32
+ - uses: actions/checkout@v6
33
+ - name: Install uv
34
+ uses: astral-sh/setup-uv@v7
35
+ with:
36
+ # Install a specific version of uv.
37
+ version: "0.6.14"
38
+ enable-cache: true
39
+ cache-dependency-glob: "uv.lock"
40
+ - name: Install the project
41
+ run: uv sync --all-extras --dev
42
+ - run: echo "$PWD/.venv/bin" >> $GITHUB_PATH
43
+ - uses: jakebailey/pyright-action@v3
44
+ with:
45
+ pylance-version: latest-release
@@ -0,0 +1,53 @@
1
+ name: Deploy Release Docs
2
+ on:
3
+ push:
4
+ tags:
5
+ - "v*"
6
+
7
+ concurrency:
8
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9
+ cancel-in-progress: true
10
+
11
+ jobs:
12
+ documentation:
13
+ name: Deploy release documentation
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v6
17
+ with:
18
+ fetch-depth: 0
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v7
21
+ with:
22
+ # Install a specific version of uv.
23
+ version: "0.5.1"
24
+ enable-cache: true
25
+ cache-dependency-glob: "uv.lock"
26
+ - name: Install Documentation dependencies
27
+ run: uv sync --group doc
28
+ - name: Set up build cache
29
+ uses: actions/cache@v5
30
+ id: cache
31
+ with:
32
+ key: mkdocs-material-${{ github.ref }}
33
+ path: .cache
34
+ restore-keys: |
35
+ mkdocs-material-
36
+ # derived from:
37
+ # https://github.com/RemoteCloud/public-documentation/blob/dev/.github/workflows/build_docs.yml
38
+ - name: Configure Git user
39
+ run: |
40
+ git config --local user.email "github-actions[bot]@users.noreply.github.com"
41
+ git config --local user.name "github-actions[bot]"
42
+ - name: Set release notes tag
43
+ run: |
44
+ export TAG_PATH=${{ github.ref }}
45
+ echo ${TAG_PATH}
46
+ echo "TAG_VERSION=${TAG_PATH##*/}" >> $GITHUB_ENV
47
+ echo ${TAG_VERSION}
48
+ - name: Deploy documentation
49
+ env:
50
+ GH_TOKEN: ${{ secrets.GH_TOKEN }}
51
+ run: |
52
+ git fetch origin gh-pages --depth=1
53
+ uv run mike deploy --update-alias --push ${TAG_VERSION} latest
@@ -0,0 +1,90 @@
1
+ name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
2
+
3
+ on: push
4
+
5
+ jobs:
6
+ build:
7
+ name: Build distribution 📦
8
+ runs-on: ubuntu-latest
9
+
10
+ steps:
11
+ - uses: actions/checkout@v6
12
+ - name: Install uv
13
+ uses: astral-sh/setup-uv@v7
14
+ with:
15
+ # Install a specific version of uv.
16
+ version: "0.5.5"
17
+ - name: Install the project
18
+ run: uv sync --all-extras
19
+ - name: Build distribution 📦
20
+ run: uv build
21
+ - name: Store the distribution packages
22
+ uses: actions/upload-artifact@v7
23
+ with:
24
+ name: python-package-distributions
25
+ path: dist/
26
+
27
+ publish-to-pypi:
28
+ name: >-
29
+ Publish Python 🐍 distribution 📦 to PyPI
30
+ if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
31
+ needs:
32
+ - build
33
+ runs-on: ubuntu-latest
34
+ environment:
35
+ name: pypi
36
+ url: https://pypi.org/p/bloqade-core # Replace <package-name> with your PyPI project name
37
+ permissions:
38
+ id-token: write # IMPORTANT: mandatory for trusted publishing
39
+
40
+ steps:
41
+ - name: Download all the dists
42
+ uses: actions/download-artifact@v8
43
+ with:
44
+ name: python-package-distributions
45
+ path: dist/
46
+ - name: Publish distribution 📦 to PyPI
47
+ uses: pypa/gh-action-pypi-publish@release/v1
48
+
49
+ github-release:
50
+ name: >-
51
+ Sign the Python 🐍 distribution 📦 with Sigstore
52
+ and upload them to GitHub Release
53
+ needs:
54
+ - publish-to-pypi
55
+ runs-on: ubuntu-latest
56
+
57
+ permissions:
58
+ contents: write # IMPORTANT: mandatory for making GitHub Releases
59
+ id-token: write # IMPORTANT: mandatory for sigstore
60
+
61
+ steps:
62
+ - name: Download all the dists
63
+ uses: actions/download-artifact@v8
64
+ with:
65
+ name: python-package-distributions
66
+ path: dist/
67
+ - name: Sign the dists with Sigstore
68
+ uses: sigstore/gh-action-sigstore-python@v3.3.0
69
+ with:
70
+ inputs: >-
71
+ ./dist/*.tar.gz
72
+ ./dist/*.whl
73
+ - name: Create GitHub Release
74
+ env:
75
+ GITHUB_TOKEN: ${{ github.token }}
76
+ run: >-
77
+ gh release create
78
+ '${{ github.ref_name }}'
79
+ --repo '${{ github.repository }}'
80
+ --notes ""
81
+ - name: Upload artifact signatures to GitHub Release
82
+ env:
83
+ GITHUB_TOKEN: ${{ github.token }}
84
+ # Upload to GitHub Release using the `gh` CLI.
85
+ # `dist/` contains the built packages, and the
86
+ # sigstore-produced signatures and certificates.
87
+ run: >-
88
+ gh release upload
89
+ '${{ github.ref_name }}' dist/**
90
+ --repo '${{ github.repository }}'
@@ -0,0 +1,163 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ .python-version
6
+
7
+ # C extensions
8
+ *.so
9
+
10
+ # Distribution / packaging
11
+ .Python
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ #Pipfile.lock
97
+
98
+ # poetry
99
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
103
+ #poetry.lock
104
+
105
+ # pdm
106
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
107
+ #pdm.lock
108
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
109
+ # in version control.
110
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
111
+ .pdm.toml
112
+ .pdm-python
113
+ .pdm-build/
114
+
115
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
116
+ __pypackages__/
117
+
118
+ # Celery stuff
119
+ celerybeat-schedule
120
+ celerybeat.pid
121
+
122
+ # SageMath parsed files
123
+ *.sage.py
124
+
125
+ # Environments
126
+ .env
127
+ .venv
128
+ env/
129
+ venv/
130
+ ENV/
131
+ env.bak/
132
+ venv.bak/
133
+
134
+ # Spyder project settings
135
+ .spyderproject
136
+ .spyproject
137
+
138
+ # Rope project settings
139
+ .ropeproject
140
+
141
+ # mkdocs documentation
142
+ /site
143
+
144
+ # mypy
145
+ .mypy_cache/
146
+ .dmypy.json
147
+ dmypy.json
148
+
149
+ # Pyre type checker
150
+ .pyre/
151
+
152
+ # pytype static type analyzer
153
+ .pytype/
154
+
155
+ # Cython debug symbols
156
+ cython_debug/
157
+
158
+ # PyCharm
159
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
160
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
161
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
162
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
163
+ #.idea/
@@ -0,0 +1,38 @@
1
+ # See https://pre-commit.com for more information
2
+ # See https://pre-commit.com/hooks.html for more hooks
3
+ repos:
4
+ - repo: https://github.com/pre-commit/pre-commit-hooks
5
+ rev: v4.6.0
6
+ hooks:
7
+ - id: check-yaml
8
+ args: ['--unsafe']
9
+ - id: end-of-file-fixer
10
+ - id: trailing-whitespace
11
+ - repo: https://github.com/pycqa/isort
12
+ rev: 6.0.1
13
+ hooks:
14
+ - id: isort
15
+ name: isort (python)
16
+ - repo: https://github.com/psf/black
17
+ rev: 25.1.0
18
+ hooks:
19
+ - id: black
20
+ - repo: https://github.com/charliermarsh/ruff-pre-commit
21
+ # Ruff version.
22
+ rev: "v0.3.5"
23
+ hooks:
24
+ - id: ruff
25
+ - repo: local
26
+ hooks:
27
+ - id: pytest-check
28
+ name: pytest-check
29
+ entry: uv run pytest test
30
+ language: system
31
+ pass_filenames: false
32
+ always_run: true
33
+ - id: pyright-check
34
+ name: pyright-check
35
+ entry: uv run pyright src
36
+ language: system
37
+ pass_filenames: false
38
+ always_run: true