Update numpy requirement from 1.26.4 to 2.0.0
Fixes #618
Updates the requirements on numpy to permit the latest version.
Release notes
Sourced from numpy's releases.
v2.0.0
NumPy 2.0.0 Release Notes
NumPy 2.0.0 is the first major release since 2006. It is the result of 11 months of development since the last feature release and is the work of 212 contributors spread over 1078 pull requests. It contains a large number of exciting new features as well as changes to both the Python and C APIs.
This major release includes breaking changes that could not happen in a regular minor (feature) release - including an ABI break, changes to type promotion rules, and API changes which may not have been emitting deprecation warnings in 1.26.x. Key documents related to how to adapt to changes in NumPy 2.0, in addition to these release notes, include:
- The numpy-2-migration-guide
- The Numpy 2.0-specific advice in for downstream package authors
Highlights
Highlights of this release include:
- New features:
- A new variable-length string dtype,
numpy.dtypes.StringDTypeand a newnumpy.stringsnamespace with performant ufuncs for string operations,- Support for
float32andlongdoublein allnumpy.fftfunctions,- Support for the array API standard in the main
numpynamespace.- Performance improvements:
- Sorting functions
sort,argsort,partition,argpartitionhave been accelerated through the use of the Intel x86-simd-sort and Google Highway libraries, and may see large (hardware-specific) speedups,- macOS Accelerate support and binary wheels for macOS >=14, with significant performance improvements for linear algebra operations on macOS, and wheels that are about 3 times smaller,
numpy.charfixed-length string operations have been accelerated by implementing ufuncs that also supportnumpy.dtypes.StringDTypein addition to the fixed-length string dtypes,- A new tracing and introspection API,
numpy.lib.introspect.opt_func_info, to determine which hardware-specific kernels are available and will be dispatched to.numpy.savenow uses pickle protocol version 4 for saving arrays with object dtype, which allows for pickle objects larger than 4GB and improves saving speed by about 5% for large arrays.- Python API improvements:
... (truncated)
Commits
1d49c7fMerge pull request #26698 from charris/prepare-2.0.02103511DOC: Remove duplicate in author list.db8030eBUG: Change cibuildwheel version [wheel build]1a68264REL: Prepare for the NumPy 2.0.0 release [wheel build]c8665baMerge pull request #26696 from charris/backport-26582103f4ddMerge pull request #26697 from charris/backport-25963c193dcdMerge pull request #26695 from charris/backport-266678fa8191BUG: Fix bug in numpy.pad() (#25963)ece3559BUG: weighted nanpercentile, nanquantile and multi-dim q (#26582)b31e195BUG: Adds asanyarray to start of linalg.cross (#26667)- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 97.7%. Comparing base (
b1c109e) to head (fe61b1a). Report is 316 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #656 +/- ##
======================================
Coverage 97.7% 97.7%
======================================
Files 166 166
Lines 3247 3247
Branches 795 795
======================================
Hits 3174 3174
Misses 48 48
Partials 25 25
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚨 Try these New Features:
- Flaky Tests Detection - Detect and resolve failed and flaky tests
@dependabot rebase
The doc examples in this PR are still failing because the expected output is 4 but doctest calculates it as np.float64(4). Why don't we see similar failures in pytest workflows?
The failures are due to newer print options in numpy. So, it's understandable they don't appear as failures in pytest workflows as we don't use print to compare the calculated and expected outputs.
https://numpy.org/neps/nep-0051-scalar-representation.html
My suggestion is to change the expected outputs in docstring examples to be consistent with the new print options. WDYT @vprusso ?
We could set the print option to use an earlier version of numpy. But this does not make sense as a user will see the newer scalar representations pop up if they print something locally.
This PR is very close. The only failure that we have to deal with is below:
File "autoapi/state_opt/symmetric_extension_hierarchy/index.rst", line 164, in default
Failed example:
np.around(symmetric_extension_hierarchy(states=states, probs=None, level=2), decimals=2)
Exception raised:
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/doctest.py", line 1355, in __run
exec(compile(example.source, filename, "single",
File "<doctest default[12]>", line 1, in <module>
np.around(symmetric_extension_hierarchy(states=states, probs=None, level=2), decimals=2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/toqito/toqito/toqito/state_opt/symmetric_extension_hierarchy.py", line 197, in symmetric_extension_hierarchy
sol_default = problem.solve()
^^^^^^^^^^^^^^^
File "/home/runner/.cache/pypoetry/virtualenvs/toqito-QfgmswsN-py3.11/lib/python3.11/site-packages/cvxpy/problems/problem.py", line 503, in solve
return solve_func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.cache/pypoetry/virtualenvs/toqito-QfgmswsN-py3.11/lib/python3.11/site-packages/cvxpy/problems/problem.py", line 1073, in _solve
data, solving_chain, inverse_data = self.get_problem_data(
^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.cache/pypoetry/virtualenvs/toqito-QfgmswsN-py3.11/lib/python3.11/site-packages/cvxpy/problems/problem.py", line 696, in get_problem_data
data, inverse_data = solving_chain.apply(self, verbose)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.cache/pypoetry/virtualenvs/toqito-QfgmswsN-py3.11/lib/python3.11/site-packages/cvxpy/reductions/chain.py", line 76, in apply
problem, inv = r.apply(problem)
^^^^^^^^^^^^^^^^
File "/home/runner/.cache/pypoetry/virtualenvs/toqito-QfgmswsN-py3.11/lib/python3.11/site-packages/cvxpy/reductions/solvers/conic_solvers/scs_conif.py", line 214, in apply
return super(SCS, self).apply(problem)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.cache/pypoetry/virtualenvs/toqito-QfgmswsN-py3.11/lib/python3.11/site-packages/cvxpy/reductions/solvers/conic_solvers/conic_solver.py", line 355, in apply
problem, data, inv_data = self._prepare_data_and_inv_data(problem)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.cache/pypoetry/virtualenvs/toqito-QfgmswsN-py3.11/lib/python3.11/site-packages/cvxpy/reductions/solvers/conic_solvers/conic_solver.py", line 332, in _prepare_data_and_inv_data
problem = self.format_constraints(problem, self.EXP_CONE_ORDER)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.cache/pypoetry/virtualenvs/toqito-QfgmswsN-py3.11/lib/python3.11/site-packages/cvxpy/reductions/solvers/conic_solvers/conic_solver.py", line 264, in format_constraints
unspecified, remainder = divmod(problem.A.shape[0] *
^^^^^^^^^^^^^^^^^^^^^^^^^^^
OverflowError: Python integer 2313073664 out of bounds for int32
https://github.com/vprusso/toqito/actions/runs/9933035887/job/27435221058#step:5:3171
I think it's better to disable this for now and create a separate issue for the error. It will take me a while to dig into the source of the raised error.
Looks great, @purva-thakre. Once the merge conflict with the poetry.lock file is resolved, I think it should be good to go!
@dependabot rebase
Looks like this PR has been edited by someone other than Dependabot. That means Dependabot can't rebase it - sorry!
If you're happy for Dependabot to recreate it from scratch, overwriting any edits, you can request @dependabot recreate.
Will check on what the installation issues mean later.
https://github.com/vprusso/toqito/actions/runs/9939417469/job/27454339453?pr=656#step:4:283
Closing this for a new PR. I can't figure out the source of the build error.
I don't see similar errors locally. 🤷🏾♀️
OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.
If you change your mind, just re-open this PR and I'll resolve any conflicts on it.
- If https://github.com/vprusso/toqito/pull/656/commits/8a1283bd94a2d123073a39883c242e66db7865bc does not work, try doing what the error message says https://stackoverflow.com/a/64172202
- Or use conda to install cvxopt https://stackoverflow.com/a/67500504
We are already doing what the top voted answer recommends.
There are two different errors. cvxopt and pep 517 related SO links are above.
The other one is error: command '/usr/bin/gcc' failed with exit code 1: https://stackoverflow.com/questions/19955775/error-command-gcc-failed-with-exit-status-1-on-centos
Why do we see these failures for python 3.12 on ubuntu and macos only?
Not the same error we are getting but similar pep517 messages were fixed by downgrading poetry.
https://github.com/python-poetry/poetry/issues/7611
https://github.com/vprusso/toqito/pull/656/commits/307e79830bcb7e595f496b3ade99cdb63daf9184 might have worked except that cvxopt is being installed as a dependency again through poetry install.
Need to create a better dependency group.
https://github.com/python-poetry/poetry/issues/7583#issuecomment-1453161741
A newer version of numpy exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged.
@dependabot recreate
Superseded by #752.