Fix sudoku exercise answer checking and variable naming conflicts in optimization_basics.jl#33
Merged
andrewrosemberg merged 8 commits intomainfrom Sep 3, 2025
Merged
Conversation
Contributor
Author
|
@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>
Copilot
AI
changed the title
[WIP] Answer checking of sudoku exercise
Fix sudoku exercise answer checking in optimization_basics.jl
Aug 30, 2025
Collaborator
|
Did you trigger this somehow @andrewrosemberg ? Or it will just randomly create its own bug fix PRs? |
Member
trigger in the issue |
Member
Co-authored-by: andrewrosemberg <24196241+andrewrosemberg@users.noreply.github.com>
Copilot
AI
changed the title
Fix sudoku exercise answer checking in optimization_basics.jl
Fix sudoku exercise answer checking and variable naming conflicts in optimization_basics.jl
Sep 2, 2025
Member
|
@ivanightingale might checking if these solved your problem? It seems that it now works for me |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.