Skip to content

Add lin_nnzj and nln_nnzj and docstrings for functions #500

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

Merged
merged 40 commits into from
Jul 7, 2025

Conversation

arnavk23
Copy link
Contributor

@arnavk23 arnavk23 commented Jul 3, 2025

This PR adds the lin_nnzj and nln_nnzj fields to the output of the show method for AbstractNLPModelMeta and documents the purpose and usage of the scaling-related functions exported in the NLPModels API: varscale, lagscale, and conscale.

Closes #485
Closes #413

@arnavk23
Copy link
Contributor Author

arnavk23 commented Jul 3, 2025

@amontoison please review the changes made here

@amontoison amontoison self-requested a review July 3, 2025 11:15
@amontoison
Copy link
Member

@arnavk23 I will review the PR asap.

@amontoison
Copy link
Member

CI failures are related.

@tmigot
Copy link
Member

tmigot commented Jul 3, 2025

@arnavk23 I checked the issue #413 and to close we would need to add lin_nnzj and nln_nnzj in the README.md as well.

@arnavk23
Copy link
Contributor Author

arnavk23 commented Jul 3, 2025

@tmigot can you review the changes made

Copy link
Member

@tmigot tmigot left a comment

Choose a reason for hiding this comment

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

You have to change
https://github.com/JuliaSmoothOptimizers/NLPModels.jl/blob/main/test/nlp/show.jl
and maybe this
https://github.com/JuliaSmoothOptimizers/NLPModels.jl/blob/main/test/nls/show.jl
so that the tests pass.
Can you also edit the README.md in this PR?

Thank you!

arnavk23 and others added 5 commits July 4, 2025 14:31
Co-authored-by: Tangi Migot <tangi.migot@gmail.com>
Co-authored-by: Tangi Migot <tangi.migot@gmail.com>
@arnavk23 arnavk23 requested a review from tmigot July 4, 2025 10:06
arnavk23 and others added 6 commits July 5, 2025 18:20
Co-authored-by: Tangi Migot <tangi.migot@gmail.com>
Co-authored-by: Tangi Migot <tangi.migot@gmail.com>
@arnavk23 arnavk23 requested a review from tmigot July 5, 2025 14:52
@arnavk23
Copy link
Contributor Author

arnavk23 commented Jul 5, 2025

@tmigot I have passed both for SimpleNLPModel but for Generic even when the showed and the expected are the same, it is throwing an error for both test/nlp/show.jl and test/nls/show.jl

@arnavk23
Copy link
Contributor Author

arnavk23 commented Jul 5, 2025

@tmigot this is what is coming as I was saying above -

Expression: strip.(split(chomp(showed), "\n")) == strip.(split(chomp(expected), "\n"))
Evaluated: SubString{String}["Problem name: Generic", "All variables: ████████████████████ 1 All constraints: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0", "free: ████████████████████ 1 free: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0", "lower: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0 lower: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0", "upper: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0 upper: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0", "low/upp: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0 low/upp: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0", "fixed: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0 fixed: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0", "infeas: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0 infeas: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0", "nnzh: ( 0.00% sparsity) 1 linear: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0", "nonlinear: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0", "nnzj: (------% sparsity)", "lin_nnzj: (------% sparsity)", "nln_nnzj: (------% sparsity)", ""] == SubString{String}["Problem name: Generic", "All variables: ████████████████████ 1 All constraints: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0", "free: ████████████████████ 1 free: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0", "lower: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0 lower: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0", "upper: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0 upper: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0", "low/upp: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0 low/upp: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0", "fixed: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0 fixed: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0", "infeas: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0 infeas: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0", "nnzh: ( 0.00% sparsity) 1 linear: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0", "nonlinear: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0", "nnzj: (------% sparsity)", "lin_nnzj: (------% sparsity)", "nln_nnzj: (------% sparsity)"]

Stacktrace:
[1] macro expansion
@ ~/hostedtoolcache/julia/1.11.5/aarch64/share/julia/stdlib/v1.11/Test/src/Test.jl:679 [inlined]
[2] macro expansion
@ ~/work/NLPModels.jl/NLPModels.jl/test/nlp/show.jl:49 [inlined]
[3] macro expansion
@ ~/hostedtoolcache/julia/1.11.5/aarch64/share/julia/stdlib/v1.11/Test/src/Test.jl:1704 [inlined]
[4] top-level scope
@ ~/work/NLPModels.jl/NLPModels.jl/test/nlp/show.jl:2
Test Summary: | Pass Fail Total Time
Increase coverage of nlp/show.jl | 1 1 2 2.0s
ERROR: LoadError: Some tests did not pass: 1 passed, 1 failed, 0 errored, 0 broken.
in expression starting at /Users/runner/work/NLPModels.jl/NLPModels.jl/test/nlp/show.jl:1
in expression starting at /Users/runner/work/NLPModels.jl/NLPModels.jl/test/runtests.jl:9
Package NLPModels errored during testing
Error: Process completed with exit code 1.

@arnavk23 arnavk23 requested a review from amontoison July 6, 2025 12:00
@arnavk23
Copy link
Contributor Author

arnavk23 commented Jul 7, 2025

@amontoison @tmigot I have checked it on my system now properly, it works. It should be passing all the tests now.

@arnavk23
Copy link
Contributor Author

arnavk23 commented Jul 7, 2025

@amontoison @tmigot It passes all tests except the breakage/upload one

@tmigot tmigot merged commit d258d35 into JuliaSmoothOptimizers:main Jul 7, 2025
72 of 73 checks passed
@tmigot
Copy link
Member

tmigot commented Jul 7, 2025

Thanks @arnavk23 !

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.

Documentation of varscale, lagscale and conscale Add lin_nnzj and nln_nnzj in show
3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy