Skip to content

Centralize sparsediffpy import into _bindings.py#174

Merged
Transurgeon merged 4 commits intomasterfrom
more-pr-comments
Mar 4, 2026
Merged

Centralize sparsediffpy import into _bindings.py#174
Transurgeon merged 4 commits intomasterfrom
more-pr-comments

Conversation

@Transurgeon
Copy link
Member

Move the duplicated try/except import of sparsediffpy from c_problem.py and converters.py into a single _bindings.py module.

Description

Please include a short summary of the change.
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.

Move the duplicated try/except import of sparsediffpy from c_problem.py
and converters.py into a single _bindings.py module.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Benchmarks that have improved:

   before           after         ratio
 [ce8fda13]       [3f54d9cb]
  •     300±0ms          256±0ms     0.85  simple_QP_benchmarks.SimpleQPBenchmark.time_compile_problem
    
  •     853±0ms          721±0ms     0.84  simple_QP_benchmarks.LeastSquares.time_compile_problem
    
  •     1.37±0s          1.12±0s     0.82  gini_portfolio.Cajas.time_compile_problem
    

Benchmarks that have stayed the same:

   before           after         ratio
 [ce8fda13]       [3f54d9cb]
      492±0ms          524±0ms     1.06  semidefinite_programming.SemidefiniteProgramming.time_compile_problem
      13.3±0s          14.1±0s     1.06  finance.CVaRBenchmark.time_compile_problem
      1.53±0s          1.58±0s     1.03  tv_inpainting.TvInpainting.time_compile_problem
     37.7±0ms         38.4±0ms     1.02  matrix_stuffing.SmallMatrixStuffing.time_compile_problem
      286±0ms          291±0ms     1.02  matrix_stuffing.ParamSmallMatrixStuffing.time_compile_problem
      1.47±0s          1.49±0s     1.02  matrix_stuffing.ParamConeMatrixStuffing.time_compile_problem
      9.88±0s          10.0±0s     1.01  simple_LP_benchmarks.SimpleLPBenchmark.time_compile_problem
     15.3±0ms         15.5±0ms     1.01  simple_LP_benchmarks.SimpleFullyParametrizedLPBenchmark.time_compile_problem
      277±0ms          279±0ms     1.01  slow_pruning_1668_benchmark.SlowPruningBenchmark.time_compile_problem
      4.53±0s          4.57±0s     1.01  svm_l1_regularization.SVMWithL1Regularization.time_compile_problem
      134±0ms          135±0ms     1.01  high_dim_convex_plasticity.ConvexPlasticity.time_compile_problem
      1.00±0s          1.01±0s     1.01  finance.FactorCovarianceModel.time_compile_problem
      5.47±0s          5.48±0s     1.00  optimal_advertising.OptimalAdvertising.time_compile_problem
      4.00±0s          4.01±0s     1.00  huber_regression.HuberRegression.time_compile_problem
      336±0ms          337±0ms     1.00  gini_portfolio.Yitzhaki.time_compile_problem
      239±0ms          239±0ms     1.00  gini_portfolio.Murray.time_compile_problem
      682±0ms          681±0ms     1.00  matrix_stuffing.ConeMatrixStuffingBench.time_compile_problem
      890±0ms          888±0ms     1.00  simple_LP_benchmarks.SimpleScalarParametrizedLPBenchmark.time_compile_problem
      21.5±0s          21.4±0s     1.00  sdp_segfault_1132_benchmark.SDPSegfault1132Benchmark.time_compile_problem
     15.6±0ms         15.5±0ms     0.99  simple_QP_benchmarks.ParametrizedQPBenchmark.time_compile_problem
      2.63±0s          2.54±0s     0.96  quantum_hilbert_matrix.QuantumHilbertMatrix.time_compile_problem
      1.91±0s          1.82±0s     0.95  simple_QP_benchmarks.UnconstrainedQP.time_compile_problem

@Transurgeon Transurgeon merged commit 2a492a7 into master Mar 4, 2026
45 of 47 checks passed
@Transurgeon Transurgeon deleted the more-pr-comments branch March 4, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant