Skip to content

Conversation

@Transurgeon
Copy link
Collaborator

@Transurgeon Transurgeon commented Nov 9, 2025

Description

Please include a short summary of the change.
This PR fixes some CI failures (not sure why they resurfaced now though) relating to skipping tests with unittest not working.
See the logs in the following recent build run:


cvxpy/tests/test_matrix_utilities.py::TestMatrixUtilities::test_convert
cvxpy/tests/test_matrix_utilities.py::TestMatrixUtilities::test_convert
cvxpy/tests/test_matrix_utilities.py::TestMatrixUtilities::test_convert
cvxpy/tests/test_matrix_utilities.py::TestMatrixUtilities::test_convert
cvxpy/tests/test_matrix_utilities.py::TestMatrixUtilities::test_convert
cvxpy/tests/test_matrix_utilities.py::TestMatrixUtilities::test_convert
  /home/runner/work/cvxpy/cvxpy/cvxpy/tests/test_matrix_utilities.py:56: PendingDeprecationWarning: the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
    np.matrix(underlying_values, dtype=dtype),

cvxpy/tests/test_python_backends.py::TestSciPyBackend::test_tensor_view_add_dicts
  /home/runner/work/cvxpy/cvxpy/cvxpy/tests/test_python_backends.py:2538: SparseEfficiencyWarning: Comparing two sparse matrices using == is inefficient. Try using != instead.
    assert view.add_dicts({"a": one}, {"a": two}) == {"a": three}

cvxpy/tests/test_python_backends.py::TestSciPyBackend::test_tensor_view_add_dicts
  /home/runner/work/cvxpy/cvxpy/cvxpy/tests/test_python_backends.py:2540: SparseEfficiencyWarning: Comparing two sparse matrices using == is inefficient. Try using != instead.
    assert view.add_dicts({"a": {"c": one}}, {"a": {"c": one}}) == {"a": {"c": two}}

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED cvxpy/tests/test_copt_write.py::test_write - unittest.case.SkipTest: COPT is not installed.
FAILED cvxpy/tests/test_gurobi_write.py::test_write - unittest.case.SkipTest: GUROBI is not installed.
========== 2 failed, 1280 passed, 447 skipped, 215 warnings in 38.33s ==========

Issue link (if applicable):

Type of change

  • New feature (backwards compatible)
  • New feature (breaking API changes)
  • Bug fix
  • Other (Documentation, CI, ...)

Contribution checklist

  • Add our license to new files.
  • Check that your code adheres to our coding style.
  • Write unittests.
  • Run the unittests and check that they’re passing.
  • Run the benchmarks to make sure your change doesn’t introduce a regression.

@github-actions
Copy link

github-actions bot commented Nov 9, 2025

Benchmarks that have stayed the same:

   before           after         ratio
 [ab16d411]       [f9211a90]
      849±0ms          889±0ms     1.05  simple_QP_benchmarks.LeastSquares.time_compile_problem
     43.8±0ms         45.4±0ms     1.04  matrix_stuffing.SmallMatrixStuffing.time_compile_problem
      1.66±0s          1.72±0s     1.03  tv_inpainting.TvInpainting.time_compile_problem
      13.2±0s          13.6±0s     1.03  finance.CVaRBenchmark.time_compile_problem
      718±0ms          734±0ms     1.02  matrix_stuffing.ConeMatrixStuffingBench.time_compile_problem
      5.01±0s          5.12±0s     1.02  optimal_advertising.OptimalAdvertising.time_compile_problem
      343±0ms          349±0ms     1.02  gini_portfolio.Yitzhaki.time_compile_problem
      255±0ms          259±0ms     1.02  simple_QP_benchmarks.SimpleQPBenchmark.time_compile_problem
      1.09±0s          1.10±0s     1.01  finance.FactorCovarianceModel.time_compile_problem
      5.17±0s          5.24±0s     1.01  svm_l1_regularization.SVMWithL1Regularization.time_compile_problem
      242±0ms          245±0ms     1.01  high_dim_convex_plasticity.ConvexPlasticity.time_compile_problem
      22.7±0s          22.9±0s     1.01  sdp_segfault_1132_benchmark.SDPSegfault1132Benchmark.time_compile_problem
      239±0ms          241±0ms     1.01  gini_portfolio.Murray.time_compile_problem
      4.65±0s          4.69±0s     1.01  huber_regression.HuberRegression.time_compile_problem
      1.14±0s          1.15±0s     1.01  gini_portfolio.Cajas.time_compile_problem
      936±0ms          938±0ms     1.00  simple_LP_benchmarks.SimpleScalarParametrizedLPBenchmark.time_compile_problem
      1.87±0s          1.86±0s     1.00  simple_QP_benchmarks.UnconstrainedQP.time_compile_problem
      11.6±0s          11.4±0s     0.98  simple_LP_benchmarks.SimpleLPBenchmark.time_compile_problem
      2.37±0s          2.33±0s     0.98  simple_LP_benchmarks.SimpleFullyParametrizedLPBenchmark.time_compile_problem
      294±0ms          289±0ms     0.98  matrix_stuffing.ParamSmallMatrixStuffing.time_compile_problem
      3.29±0s          3.20±0s     0.97  quantum_hilbert_matrix.QuantumHilbertMatrix.time_compile_problem
      306±0ms          297±0ms     0.97  slow_pruning_1668_benchmark.SlowPruningBenchmark.time_compile_problem
      560±0ms          538±0ms     0.96  semidefinite_programming.SemidefiniteProgramming.time_compile_problem
      591±0ms          566±0ms     0.96  simple_QP_benchmarks.ParametrizedQPBenchmark.time_compile_problem
      1.48±0s          1.40±0s     0.94  matrix_stuffing.ParamConeMatrixStuffing.time_compile_problem

@PTNobel PTNobel merged commit a962739 into master Nov 10, 2025
43 of 45 checks passed
@PTNobel PTNobel deleted the attempt-fix-write-CI branch November 10, 2025 06:46
Transurgeon added a commit to cvxgrp/DNLP that referenced this pull request Nov 12, 2025
* Various fixes to help CVXPYlayers (cvxpy#2951)

* Removes assert that prevents canonicalizing without parameter values

* renames c -> q in the ParamConicProg so it has the same API as ParamQuadProg

* Fixes a bug in the tests

* Fixes a bug

* Fix qoco links (cvxpy#2963)

* Bump astral-sh/setup-uv from 6 to 7 (cvxpy#2967)

Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 6 to 7.
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](astral-sh/setup-uv@v6...v7)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fixes .name() for multiply expressions and HiGHS tests (cvxpy#2983)

* Fixes .name() for multiply expressions

* Fixes tests lol

* Fixes HiGHS tests

* Bump github/codeql-action from 3.30.6 to 4.31.2 (cvxpy#2986)

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.30.6 to 4.31.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@64d10c1...0499de3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.2
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* adding variable bounds to PDLP (cvxpy#2974)

* adding variable bounds to pdlp

* add check for none variable bounds

---------

Co-authored-by: William Zijie Zhang <[email protected]>

* Fix issue 1222 (cvxpy#2971)

* dev container + powconeND template

* working on supporting powconeND

* added more support for powconeND

* trying to add support for ND cone

* tested passing generalized power cones to clarabel

* continuing working on nd, new example

* preliminary version, pre-dual handling. Need to check axis

* fixed axis handling, starting tests for general variable orderin

* tested variable switching for powconeND

* fix shape problems for power cone nd dual vars

* fix shape problems for power cone nd dual vars

* found bug in conversion of nd->3d cones

* clean-up changes, removed stale TODOs, more testing

* "cleaning up"

* moved checking for exotic constraints to within each solver loop

* slight logic improvement

* removed stale TODOs and cleaned up code

* fixed powconeND shape property when axis=1

* implemented additional checks in solving_chain, made powconeND tests compatible with cvxpy test set

* improved testing depth and readability

* suggested changes by Steven and William

* added explanation in power.py

* fixed bug causing unnecessary constraints to be added to the problem

* removed redundant axis checks in cone_matrix_stuffing

* Removed stale note in power.py

Removed note about potential 3-tuple return type.

* Extend sum_largest/sum_smallest to support float k and optimize cvar implementation (cvxpy#2985)

* support float k in sum_largest and sum_smallest

* support float k in lambda_sum_largest and lambda_sum_smallest

* reimplement cvar using sum_largest instead of dotsort

* Enhance atom validation with NumPy and improve error messages (cvxpy#2976)

* Use NumPy validation in hstack, vstack, concatenate, and sum

Replaces custom validation with NumPy's input validation using mock
arrays. Improves error messages by adding CVXPY context. Adds missing
test_hstack coverage.

This addresses the atoms specifically mentioned in cvxpy#2613 and improves
error message traceability as requested in cvxpy#2620. Other atoms may
benefit from similar improvements in future work.

* Refactor per reviewer feedback

- Consolidate validation: validate_arguments() now calls shape_from_args()
- Add cp. prefix to error messages for clarity
- Eliminates code duplication while maintaining error handling

* Update cuopt_conif.py for cuopt 25.10 (cvxpy#2989)

* Added feasibility example (cvxpy#2990)

* Added feasibility example + associated test

* Added feasibility example + associated test

* Modified feasibility speedup test to ensure same rng

* Apply suggestions from code review

Co-authored-by: Parth Nobel <[email protected]>

---------

Co-authored-by: Parth Nobel <[email protected]>

* CI: change copt write test to use pytest skipif (cvxpy#2993)

* change copt write test to use pytest skipif

* change gurobi as well

* revret changes to sum

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Parth Nobel <[email protected]>
Co-authored-by: Govind Chari <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: William Zijie Zhang <[email protected]>
Co-authored-by: Nika Zahedi <[email protected]>
Co-authored-by: David Pérez Piñeiro <[email protected]>
Co-authored-by: Zak Kraehling <[email protected]>
Co-authored-by: Trevor McKay <[email protected]>
Co-authored-by: RyuGood0 <[email protected]>
Co-authored-by: Parth Nobel <[email protected]>
Transurgeon added a commit that referenced this pull request Nov 24, 2025
* change copt write test to use pytest skipif

* change gurobi as well
@Transurgeon Transurgeon mentioned this pull request Nov 24, 2025
Transurgeon added a commit that referenced this pull request Nov 24, 2025
* adding MIP warmstart for XPRESS (#2945)

Co-authored-by: Marc Bataillou Almagro <[email protected]>

* Support for cvxpy.convolve into complex2real, fix sparse convolutions in Scipy (#2947)

* Add support for cvxpy.convolve into complex2real

Altough cvxpy.conv is supported, cvxpy.convolve is a different atom
and thus requires to be explicitly specified in order to be supported.

Fixes #2946

* Add a test for complex cp.conv and cp.convolve

* Fix sparse convolution for the Scipy backend

If the lhs operand has zeroes in it, they get consumed by the .tocoo
call. This means that the amount of nonzero elements computed beforehand
is no longer correct, yielding a dimension mismatch a few lines later.

This is a tentative attempt at fixing this, should be carefully analyzed
by someone that can actually read this numpy juggling.

Fixes #2949

* passing original variable names and constraint ids to improve debugging (#2948)

Co-authored-by: Marc Bataillou Almagro <[email protected]>

* Revert "Passing original variable names and constraint ids to improve debugging" (#2950)

* Revert "passing original variable names and constraint ids to improve debuggi…"

This reverts commit 9fb1974.

* Revert "patch empty breaking empty rownames for xpress>=9.5 (#2745)"

This reverts commit 6870f5f.

* Revert "adding MIP warmstart for XPRESS (#2945)"

This reverts commit 9e36b12.

---------

Co-authored-by: William Zijie Zhang <[email protected]>

* Update Python version in devcontainer configuration (#2955)

* consolidate warmstart and varname changes (#2957)

* Various fixes to help CVXPYlayers (#2951)

* Removes assert that prevents canonicalizing without parameter values

* renames c -> q in the ParamConicProg so it has the same API as ParamQuadProg

* Fixes a bug in the tests

* Fixes a bug

* Fix qoco links (#2963)

* Fixes .name() for multiply expressions and HiGHS tests (#2983)

* Fixes .name() for multiply expressions

* Fixes tests lol

* Fixes HiGHS tests

* adding variable bounds to PDLP (#2974)

* adding variable bounds to pdlp

* add check for none variable bounds

---------

Co-authored-by: William Zijie Zhang <[email protected]>

* Enhance atom validation with NumPy and improve error messages (#2976)

* Use NumPy validation in hstack, vstack, concatenate, and sum

Replaces custom validation with NumPy's input validation using mock
arrays. Improves error messages by adding CVXPY context. Adds missing
test_hstack coverage.

This addresses the atoms specifically mentioned in #2613 and improves
error message traceability as requested in #2620. Other atoms may
benefit from similar improvements in future work.

* Refactor per reviewer feedback

- Consolidate validation: validate_arguments() now calls shape_from_args()
- Add cp. prefix to error messages for clarity
- Eliminates code duplication while maintaining error handling

* Extend sum_largest/sum_smallest to support float k and optimize cvar implementation (#2985)

* support float k in sum_largest and sum_smallest

* support float k in lambda_sum_largest and lambda_sum_smallest

* reimplement cvar using sum_largest instead of dotsort

* Update cuopt_conif.py for cuopt 25.10 (#2989)

* CI: change copt write test to use pytest skipif (#2993)

* change copt write test to use pytest skipif

* change gurobi as well

* Make get_problem_data work with gp = True and parameter values not set (#3005)

* make get_problem_data work with dgp and no param values

* add tests for get_problem_data(gp=True, ...) with no param values

* clearer comment and another test

* fix comment for tests

* more comments

---------

Co-authored-by: Marc Bataillou Almagro <[email protected]>
Co-authored-by: Marc Bataillou Almagro <[email protected]>
Co-authored-by: Josef Gajdusek <[email protected]>
Co-authored-by: Parth Nobel <[email protected]>
Co-authored-by: Nika Zahedi <[email protected]>
Co-authored-by: Govind Chari <[email protected]>
Co-authored-by: William Zijie Zhang <[email protected]>
Co-authored-by: Zak Kraehling <[email protected]>
Co-authored-by: David Pérez Piñeiro <[email protected]>
Co-authored-by: Trevor McKay <[email protected]>
Co-authored-by: Steven Diamond <[email protected]>
@Transurgeon Transurgeon mentioned this pull request Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants