-
Notifications
You must be signed in to change notification settings - Fork 7
Fix sudoku exercise answer checking and variable naming conflicts in optimization_basics.jl #33
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
Conversation
|
@andrewrosemberg 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs. I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review. |
Co-authored-by: andrewrosemberg <24196241+andrewrosemberg@users.noreply.github.com>
Co-authored-by: andrewrosemberg <24196241+andrewrosemberg@users.noreply.github.com>
|
Did you trigger this somehow @andrewrosemberg ? Or it will just randomly create its own bug fix PRs? |
trigger in the issue |
Co-authored-by: andrewrosemberg <24196241+andrewrosemberg@users.noreply.github.com>
|
@ivanightingale might checking if these solved your problem? It seems that it now works for me |
This PR fixes critical issues in the optimization exercises in
class01/background_materials/optimization_basics.jlthat were preventing proper functionality in Pluto.jl notebooks.Issues Fixed
1. Sudoku Exercise Answer Checking (Issue #32)
Tuple Syntax Error: The
ground_truth_sdefinition was missing a trailing comma, causing it to create aVectorinstead of aNamedTuple:Incompatible Matrix Format Comparison: The answer checking was attempting to directly compare incompatible matrix formats:
anss.x_ss: A 3D binary matrix fromJuMP.value.(sudoku[:x_s])wherex_s[i,j,k] = 1means valuekis at position(i,j)ground_truth_s.x_ss: A 2D solution matrix with sudoku values 1-9Solution: Added a conversion function
convert_3d_to_solution()that transforms the 3D binary indicator matrix into the standard 2D sudoku solution format for proper comparison.2. Variable Naming Conflicts (Issue #31)
Fixed a Pluto.jl variable naming conflict in the Rosenbrock valley exercise where line 726 incorrectly referenced a bare
xvariable:This was causing conflicts because
xreferenced the JuMP variable from the NLP model instead of the student's answeransd, creating variable dependency issues in Pluto.jl.Verification
Fixes #32 and #31.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.