Skip to content

Comments

Add broadcasting to Convex.jl#728

Draft
elsoroka wants to merge 12 commits intojump-dev:masterfrom
elsoroka:master
Draft

Add broadcasting to Convex.jl#728
elsoroka wants to merge 12 commits intojump-dev:masterfrom
elsoroka:master

Conversation

@elsoroka
Copy link

@elsoroka elsoroka commented Feb 22, 2026

Claude and I addressed issue #479 in the CVXPY Workshop hackathon by adding support and tests for broadcasting operations.

We also added a CLAUDE.md file for other developers using Claude.

elsoroka and others added 12 commits February 21, 2026 13:04
…t broadcasting. So far he has fixed broadcasting for + and - and authored some new tests that pass.
)

Extend broadcasting to .>=, .<=, .==, .>, .< so expressions like
`(A * x) .<= y` delegate to the non-broadcast operators when sizes
are compatible, matching the pattern established for .+ and .-.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add broadcasting support for Convex.jl expressions (jump-dev#479)
…#479)

Add broadcasted methods for -, abs, exp, log, sqrt, max, and min so that
dot-syntax (e.g. abs.(expr), .-expr, max.(expr, val)) delegates to the
existing non-broadcast implementations instead of failing with MethodError.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add broadcasting support for Convex.jl expressions (jump-dev#479)
…#479)

Add size checks to all AbstractExpr-AbstractExpr broadcasted methods so
that broadcast-compatible but different-sized expressions (e.g. (3,1) .+
(3,5)) fall back to DefaultArrayStyle instead of erroring in the Convex
operator that requires matching sizes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…dev#479)

Extend broadcast tests to cover cases where AbstractExpr operands have
broadcast-compatible but different sizes (e.g. (1,4) .+ (2,4), (2,1) .+
(2,2)), verifying the DefaultArrayStyle fallback produces correct results.

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

codecov bot commented Feb 22, 2026

Codecov Report

❌ Patch coverage is 62.83186% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.43%. Comparing base (9fb1278) to head (0e309db).

Files with missing lines Patch % Lines
src/supported_operations.jl 62.83% 42 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #728      +/-   ##
==========================================
- Coverage   98.20%   97.43%   -0.77%     
==========================================
  Files          88       88              
  Lines        5121     5234     +113     
==========================================
+ Hits         5029     5100      +71     
- Misses         92      134      +42     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@odow
Copy link
Member

odow commented Feb 22, 2026

I'm not necessarily against something like this, but I need to think about it before merging.

They may be a simpler option that works for all operators, like defining a different broadcast style.

@odow odow marked this pull request as draft February 22, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants