forked from pymc-devs/pytensor
-
Couldn't load subscription status.
- Fork 0
Numpy2 complex2 #2
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
Open
brendan-m-murphy
wants to merge
137
commits into
main
Choose a base branch
from
numpy2-complex2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
137 commits
Select commit
Hold shift + click to select a range
f2ad711
Implement unconditional constant_folding rewrite
ricardoV94 c2e88c6
Don't raise raw Exception in eval
ricardoV94 fdbf3aa
Fix bug in local_div_switch_sink rewrite
ricardoV94 fe5d98c
Use ld64 linker on Mac OS
lucianopaz d9d8dba
Run MacOS tests on version 15
lucianopaz 2315e69
support `on_unused_input` for string parameter names in `eval` (#1085)
tvwenger 3f93eed
Bump pypa/gh-action-pypi-publish from 1.10.3 to 1.12.2
dependabot[bot] fbb73eb
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] 3523bfa
Bump pypa/cibuildwheel from 2.21.2 to 2.21.3
dependabot[bot] 133abe8
Implement Kve Op and Kv helper
ricardoV94 33a4d48
Add stabilization rewrite for log of kv
ricardoV94 bad8d20
Slogdet returns naive expression and is optimized later (#1041)
tanish1729 0ba554b
Do not require RNG in 'verify_grad' (#1093)
t3chw 6de3151
Improve torch elemwise operator
Ch0ronomato 19dafe4
Add a strict argument to all zips
Armavica e44ab01
Enable the ruff rule ensuring explicit strictness for zips
Armavica 47c0943
Make non-strict zips strict in tests/scan
Armavica c15e7aa
Make non-strict zips strict in tensor/elemwise_cgen
Armavica 70e4e57
Make non-strict zip strict in scalar/loop.py
Armavica fdeabc1
Make non-strict zip strict in printing.py
Armavica 4a3d8c7
Make non-strict zip strict in test_abstract_conv
Armavica e200cb5
Rewrite local_merge_alloc to remove a non-strict zip
Armavica 69037db
Make non-strict zip strict in tensor/random/utils
Armavica a2bb4db
Make non-strict zip strict in local_subtensor_of_alloc
Armavica e8db716
Make non-strict zip strict in tensor/subtensor.py
Armavica 54fba94
Make non-strict zip strict in tensor/shape.py
Armavica 4b41e09
Add exceptions for hot loops
Armavica 7300a68
Track generated torch files for torch compiler
ae66e82
Fix test warning
c477732
Torch dispatch for scipy-like functions and Softplus (#1066)
Ch0ronomato b8356ff
Cross link random variable docs
ricardoV94 bd281be
Support consecutive integer vector indexing in Numba backend
ricardoV94 c84efa9
Bump pypa/cibuildwheel from 2.21.3 to 2.22.0
dependabot[bot] 4852503
Bump codecov/codecov-action from 4 to 5
dependabot[bot] 73b9ed7
Bump actions/setup-python from 4 to 5
dependabot[bot] 9dad122
Bump mamba-org/setup-micromamba from 1 to 2
dependabot[bot] 0824dba
Support multidimensional boolean set/inc_subtensor in Numba via rewri…
ricardoV94 58840ba
Fix JAX test check
ricardoV94 d1c5ae2
Constants are not inputs
ricardoV94 a0c64b5
Reduce overhead of JITLinker
ricardoV94 1a3af4b
Reduce overhead of Function call
ricardoV94 9e24b10
Remove Mean Op
ricardoV94 ef97287
Improve CAReduce Numba implementation
ricardoV94 18ba52c
Use infer_shape of core_op to infer Blockwise core shapes
ricardoV94 c715295
Add Numba implementation of Blockwise
ricardoV94 07bd48d
Conditionally disable caching of `to_tuple` helper due to failure in …
ricardoV94 9858b33
Implement ScalarLoop in torch backend (#958)
Ch0ronomato 231a977
Make OpFromGraph available at root scope (#1113)
ricardoV94 83c6b44
Add slowest test issue CI/CD (#1125)
williambdean 4e85676
Pytensor-native interpolation functions (#1141)
jessegrabowski 8267d0e
More robust check for multiple integer indices in numba ravel_multidi…
ricardoV94 8cc489b
Use scalar variables on Numba Elemwise dispatch
ricardoV94 ab3704b
Remove unused numba dispatch function
ricardoV94 1fc678c
Use more specific Numba fastmath flags everywhere
ricardoV94 2b57f74
Add example gallery to docs (#1150)
jessegrabowski a120dc2
Cache unique value of TensorConstants and deprecate `get_unique_const…
ricardoV94 aad6fb7
Deprecate `pytensor.get_underlying_scalar_constant`
ricardoV94 32aadc8
Deprecate `extract_constant`
ricardoV94 55f3cd0
Use more strict `get_scalar_constant_value` when the input must be a …
ricardoV94 04ce1c6
Remove internal `get_constant helper`
ricardoV94 cff058c
Do not apply `local_add_neg_to_sub` rewrite if negative variabe is a …
ricardoV94 581f65a
Adapt to Solve changes in Scipy 1.15
ricardoV94 091b664
Audit GHA workflows with zizmor (#1136)
maresb d4a2b2b
Add trusted publishing (OIDC) (#1135)
maresb a0fe30d
Update actions/attest-build-provenance to v2
maresb 35e87e0
Remove duplicated BLAS rewriting code
ricardoV94 6bdfbae
Don't attest from forks
maresb 79eee67
Scipy blas is no longer optional
ricardoV94 3409264
Lazy setuptools imports
ricardoV94 175b67b
Lazy pydot import
ricardoV94 8c276ac
Lazy filelock import
ricardoV94 0a7c60f
Lazy pdb import
ricardoV94 3599257
Replace socket.gethostname by platform.node
ricardoV94 450efff
Use more specialized imports in config utils
ricardoV94 cddf588
Respect predefined modes in `get_default_mode`
ricardoV94 4ea4259
Use latest platforms to build wheels
lucianopaz ffe1a5e
Replace np.cast with np.asarray
Armavica 637892d
Replace np.sctype2char
Armavica 9500049
Remove np.obj2sctype
Armavica 426ceb4
Replace np.find_common_type with np.result_type
Armavica 6ee0a74
Add ruff numpy2 transition rule
Armavica 4761bf5
Update numpy deprecated imports
ricardoV94 8df23c0
Handle change in behavior np.dtype
ricardoV94 534a608
Update access to `_get_ndarray_c_version`
ricardoV94 0c084d3
Replace `->elsize` by `PyArray_ITEMSIZE`
ricardoV94 529a6bb
Don't use deprecated PyArray_MoveInto
ricardoV94 61f24e9
Added missing header file
brendan-m-murphy e2200b9
Make C++ generic get/set real/imag function
brendan-m-murphy eb70f5f
Updated pytensor_complex struct to uses get/set
brendan-m-murphy 136301f
Updated assignment and operations +, -, *
brendan-m-murphy 2169028
Ruff formatting
brendan-m-murphy 30f0fa3
Pinned numpy to < 2.1
brendan-m-murphy 8143fb8
Updated Abs Op to use get_real, get_imag
brendan-m-murphy 3219100
Raise NotImplementedError for c code if numpy>=2.0
brendan-m-murphy 6b44a34
Update test to remove numpy TypeError
brendan-m-murphy 16bb9bd
Fixed new TypeError
brendan-m-murphy 618e4ec
Fixed casting in test_jacobian_scalar
brendan-m-murphy 3b4d8bb
Fixed casting in typed_list/test_basic.py
brendan-m-murphy d235173
Removed "mode" argument from test_inner_graph_...
brendan-m-murphy 2bb53a4
Changed copy to deepcopy for rng
brendan-m-murphy 2aee8ee
Added npy_2_compat code and updated np.MAXDIMS
brendan-m-murphy bec52c1
Updated MAXDIMS to RAVEL_AXIS in c code
brendan-m-murphy d75bb39
Updated axis rel'd code for CumSum
brendan-m-murphy 42706c4
Fixes to SoftMax re: NPY_RAVEL_AXIS
brendan-m-murphy f7fb21a
Fixed AxisError related bugs in elemwise.py
brendan-m-murphy a3ee7b0
Fixed failed test due to uint8 overflow
brendan-m-murphy d71861e
Moved `format` to cover "axis_code"
brendan-m-murphy 15e1f9b
replaced np.AxisError with np.exceptions.AxisError
brendan-m-murphy 888530a
Changed test to match new numpy promotion rules
brendan-m-murphy 2d031f4
Changed test to use higher precision
brendan-m-murphy 5c5880c
Changed autocaster due to new promotion rules
brendan-m-murphy 18d3e9b
Removed use of _asarray from scalar/basic.py
brendan-m-murphy 7fb2534
Fixed "amb" vs. "amd" typo
brendan-m-murphy 06399f8
Fixes missed in rebase
brendan-m-murphy a8f2802
Restored complex type code lost in rebase
brendan-m-murphy 37790e8
Fixed namespace for AxisError
brendan-m-murphy 24a0a35
Replaced eval with mapping to functions
brendan-m-murphy 3b4edc5
Updated environment.yml to match pyproject.toml
brendan-m-murphy 6540596
Formatting/fix error from rebase
brendan-m-murphy 9fd607e
Fixed format/f-string conflict from rebase
brendan-m-murphy fed9771
Fixed missed conflict from rebase
brendan-m-murphy d845542
Changed numpy pin for osx from <2 to <2.1
brendan-m-murphy d87bb11
Fixed numpy imports
brendan-m-murphy 465ba53
Updated doctests
brendan-m-murphy 1a5eff7
Updates due to new numpy conversion rules
brendan-m-murphy 1a5b97b
fixup! Updates due to new numpy conversion rules
brendan-m-murphy 014e437
Changed copy to deepcopy for rng
brendan-m-murphy abbda9c
Fixed doctest formatting
brendan-m-murphy 138e84f
Fixed RNG related tests
brendan-m-murphy 70337bb
Updated imports cond'l on numpy version
brendan-m-murphy ff6346a
Fixed jax random tests
brendan-m-murphy 14ebb2c
Updated Unique inverse output shape
brendan-m-murphy c587db2
Made numba numpy imports backward compat
brendan-m-murphy 0479af5
Fix test for neg on unsigned
brendan-m-murphy 6570f55
Suppress mypy re-import warning
brendan-m-murphy c597aa6
Fixed new option in `makeTester`
brendan-m-murphy bbcf7ff
Updated numba rng copy to deepcopy
brendan-m-murphy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,15 +21,27 @@ jobs: | |
| make_sdist: | ||
| name: Make SDist | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| # write id-token and attestations are required to attest build provenance | ||
| id-token: write | ||
| attestations: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| submodules: true | ||
| persist-credentials: false | ||
|
|
||
| - name: Build SDist | ||
| run: pipx run build --sdist | ||
|
|
||
| - name: Attest GitHub build provenance | ||
| uses: actions/attest-build-provenance@v2 | ||
| # Don't attest from forks | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository | ||
| with: | ||
| subject-path: dist/*.tar.gz | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: sdist | ||
|
|
@@ -45,24 +57,37 @@ jobs: | |
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
| - uses: hynek/build-and-inspect-python-package@v2 | ||
|
|
||
| build_wheels: | ||
| name: Build wheels for ${{ matrix.platform }} | ||
| runs-on: ${{ matrix.platform }} | ||
| permissions: | ||
| # write id-token and attestations are required to attest build provenance | ||
| id-token: write | ||
| attestations: write | ||
| strategy: | ||
| matrix: | ||
| platform: | ||
| - macos-12 | ||
| - windows-2022 | ||
| - ubuntu-20.04 | ||
| - macos-latest | ||
| - windows-latest | ||
| - ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
|
|
||
| - name: Build wheels | ||
| uses: pypa/[email protected] | ||
| uses: pypa/[email protected] | ||
|
|
||
| - name: Attest GitHub build provenance | ||
| uses: actions/attest-build-provenance@v2 | ||
| # Don't attest from forks | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository | ||
| with: | ||
| subject-path: ./wheelhouse/*.whl | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
|
|
@@ -72,13 +97,18 @@ jobs: | |
| build_universal_wheel: | ||
| name: Build universal wheel for Pyodide | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| # write id-token and attestations are required to attest build provenance | ||
| id-token: write | ||
| attestations: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.11' | ||
|
|
||
|
|
@@ -89,6 +119,13 @@ jobs: | |
| run: | | ||
| PYODIDE=1 python setup.py bdist_wheel --universal | ||
|
|
||
| - name: Attest GitHub build provenance | ||
| uses: actions/attest-build-provenance@v2 | ||
| # Don't attest from forks | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository | ||
| with: | ||
| subject-path: dist/*.whl | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: universal_wheel | ||
|
|
@@ -125,9 +162,16 @@ jobs: | |
|
|
||
| upload_pypi: | ||
| name: Upload to PyPI on release | ||
| # Use the `release` GitHub environment to protect the Trusted Publishing (OIDC) | ||
| # workflow by requiring signoff from a maintainer. | ||
| environment: release | ||
| permissions: | ||
| # write id-token is required for trusted publishing (OIDC) | ||
| id-token: write | ||
| needs: [check_dist] | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'release' && github.event.action == 'published' | ||
| # Don't publish from forks | ||
| if: github.repository_owner == 'pymc-devs' && github.event_name == 'release' && github.event.action == 'published' | ||
| steps: | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
|
|
@@ -145,7 +189,5 @@ jobs: | |
| name: universal_wheel | ||
| path: dist | ||
|
|
||
| - uses: pypa/[email protected] | ||
| with: | ||
| user: __token__ | ||
| password: ${{ secrets.pypi_password }} | ||
| - uses: pypa/[email protected] | ||
| # Implicitly attests that the packages were uploaded in the context of this workflow. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Taken from https://github.com/pymc-labs/pymc-marketing/tree/main/.github/workflows/slow-tests-issue.yml | ||
| # See the scripts in the `scripts/slowest_tests` directory for more information | ||
| --- | ||
| name: Slow Tests Issue Body | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: '0 */6 * * *' | ||
|
|
||
| permissions: | ||
| issues: write | ||
|
|
||
| jobs: | ||
| update-comment: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Install ZSH | ||
| run: sudo apt-get update && sudo apt-get install -y zsh | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.11" | ||
| - name: Trigger the script | ||
| working-directory: scripts/slowest_tests | ||
| shell: zsh {0} | ||
| run: source update-slowest-times-issue.sh | ||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # https://github.com/woodruffw/zizmor | ||
| name: zizmor GHA analysis | ||
|
|
||
| on: | ||
| push: | ||
| branches: ["main"] | ||
| pull_request: | ||
| branches: ["**"] | ||
|
|
||
| jobs: | ||
| zizmor: | ||
| name: zizmor latest via PyPI | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| security-events: write | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: hynek/setup-cached-uv@v2 | ||
|
|
||
| - name: Run zizmor 🌈 | ||
| run: uvx zizmor --format sarif . > results.sarif | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Upload SARIF file | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| # Path to SARIF file relative to the root of the repository | ||
| sarif_file: results.sarif | ||
| # Optional category for the results | ||
| # Used to differentiate multiple results for one commit | ||
| category: zizmor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| {% if pagename in ablog %} | ||
|
|
||
| <!-- Generate correct links and render github/binder/colab badges --> | ||
| {% set gh_basepath = github_user + '/' + github_repo + '/blob/' + github_version + '/' %} | ||
| {% set encoded_base = github_user + '%252F' + github_repo %} | ||
| {% set gh_binder = github_user + '/' + github_repo + '/' + github_version %} | ||
| {% set doc_path_aux = doc_path | trim('/') %} | ||
| {% set file_path = doc_path_aux + '/' + pagename + ".ipynb" %} | ||
| {% set encoded_path = file_path | replace("/", "%252F") %} | ||
|
|
||
|
|
||
| <div class="sd-text-right"> | ||
| <p> | ||
| <a href="{{ github_url + '/' + gh_basepath + file_path }}", role="button" target="_blank"> | ||
| <img src="{{ pathto('_static/github.svg', 1) }}" alt="View On GitHub"></a> | ||
|
|
||
| <a href="{{ 'https://mybinder.org/v2/gh/' + sandbox_repo + '?urlpath=git-pull%3Frepo%3Dhttps%253A%252F%252Fgithub.com%252F' + encoded_base + '%26urlpath%3Dtree%252F' + github_repo + '%252F' + encoded_path + '%26branch%3D' + github_version }}" target="_blank"> | ||
| <img src="{{ pathto('_static/binder.svg', 1) }}" alt="Open In Binder"></a> | ||
|
|
||
| <a href="{{ 'https://colab.research.google.com/github/' + gh_basepath + file_path }}" target="_blank"> | ||
| <img src="{{ pathto('_static/colab.svg', 1) }}" alt="Open In Colab"/></a> | ||
| </p> | ||
| </div> | ||
| {% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <!-- continuation of examples/page_footer.md --> | ||
| {% if pagename in ablog %} | ||
| {% set post = ablog[pagename] %} | ||
| {% for coll in post.author %} | ||
| {% if coll|length %} | ||
| {{ coll }} | ||
| {% if loop.index < post.author | length %},{% endif %} | ||
| {% else %} | ||
| {{ coll }} | ||
| {% if loop.index < post.author | length %},{% endif %} | ||
| {% endif %} | ||
| {% endfor %}. "{{ title.split(' — ')[0] }}". In: <i>Pytensor Examples</i>. Ed. by Pytensor Team. <!-- DOI: <a href={{ doi_url }}>{{ doi_code }}</a> --> | ||
| {% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| orphan: true | ||
| --- | ||
|
|
||
| # Recent updates | ||
|
|
||
| <!-- auto generated by ablog so it's empty --> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / zizmor
credential persistence through GitHub Actions artifacts Warning