Fix UndefVarError in test_zero_allocations function for AbstractNLSModel#125
Closed
Fix UndefVarError in test_zero_allocations function for AbstractNLSModel#125
Conversation
Copilot
AI
changed the title
[WIP] Fix default value of linear_api in test_zero_allocations for AbstractNLSModel
Fix UndefVarError in test_zero_allocations function for AbstractNLSModel
Aug 12, 2025
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.
Fixes a
UndefVarErrorin thetest_zero_allocationsfunction when called with anAbstractNLSModel. The issue was in the function signature on line 403 ofsrc/allocs_model.jl:The parameter
linear_api = linear_apiwas attempting to referencelinear_apiin its own default value, which caused anUndefVarError: linear_api not definedwhen the function was called.Before:
After:
The fix changes the default value to
linear_api = false, which is consistent with other similar functions in the codebase such astest_allocs_nlpmodelsand the othertest_zero_allocationsoverload forAbstractNLPModel.This is a minimal one-line fix that resolves the undefined variable error while maintaining the expected API behavior.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/JuliaPackaging/Requires.jl/tarball/62389eeff14780bfe55195b7204c0d8738436d64julia --project=. -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaSmoothOptimizers/LinearOperators.jl/tarball/1894a798ed8887895c5ae70f1fe8331c0c1d8480julia --project=. -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaSmoothOptimizers/NLPModels.jl/tarball/ac58082a07f0bd559292e869770d462d7ad0a7e2julia --project=. -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaSmoothOptimizers/NLPModelsModifiers.jl/tarball/a80505adbe42104cbbe9674591a5ccd9e9c2dfdajulia --project=. -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/JuliaTesting/ExprTools.jl/tarball/27415f162e6028e81c72b82ef756bf321213b6ecjulia --project=. -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/KristofferC/TimerOutputs.jl/tarball/3748bd928e68c7c346b52125cf41fff0de6937d0julia --project=. -e using Pkg; Pkg.instantiate()(http block)https://api.github.com/repos/c42f/FastClosures.jl/tarball/acebe244d53ee1b461970f8910c235b259e772efjulia --project=. -e using Pkg; Pkg.instantiate()(http block)pkg.julialang.orgjulia --project=. -e using Pkg; Pkg.instantiate()(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.