Skip to content
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

Update JuMP syntax in syntax.rst #272

Merged
merged 2 commits into from
Apr 15, 2024
Merged

Update JuMP syntax in syntax.rst #272

merged 2 commits into from
Apr 15, 2024

Conversation

odow
Copy link
Contributor

@odow odow commented Apr 13, 2024

I saw @pz-max's comment in #271.

This PR just updates to match the benchmark implementation:

function basic_model(n, solver)
m = Model(solver)
@variable(m, x[1:n, 1:n])
@variable(m, y[1:n, 1:n])
@constraint(m, x - y .>= 0:(n-1))
@constraint(m, x + y .>= 0)
@objective(m, Min, 2 * sum(x) + sum(y))
optimize!(m)
return objective_value(m)
end

It's fair that most people probably write out the scalar I and j version though, so up to you whether you want to merge this.

Copy link

codecov bot commented Apr 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.80%. Comparing base (5d61f95) to head (fb86bc0).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #272      +/-   ##
==========================================
- Coverage   88.94%   85.80%   -3.14%     
==========================================
  Files          15       15              
  Lines        3663     3663              
  Branches      861      861              
==========================================
- Hits         3258     3143     -115     
- Misses        281      405     +124     
+ Partials      124      115       -9     

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

Copy link
Collaborator

@FabianHofmann FabianHofmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you

@FabianHofmann FabianHofmann merged commit 3463038 into PyPSA:master Apr 15, 2024
11 of 12 checks passed
@odow odow deleted the patch-2 branch April 15, 2024 08:12
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.

2 participants