Skip to content

CUTEst SIF generator #458

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 16 commits into from
Jul 6, 2025
Merged

CUTEst SIF generator #458

merged 16 commits into from
Jul 6, 2025

Conversation

arnavk23
Copy link
Contributor

@arnavk23 arnavk23 commented Jun 30, 2025

  • The generator version supports idiomatic lazy iteration, e.g.:

    for name in select_generator(filter = n -> startswith(n, "A"))
        model = CUTEstModel(name)
        # work with model
    end
  • Docstrings were added for both functions.

Why

Closes #120.

Create select that returns a generator expression
Equivalent to (CUTEstModel(p) for p in CUTEst.select(...))

Allows:

  • Efficient lazy iteration over large problem sets.
  • Flexible filtering without needing to load all names into memory first.

@amontoison
Copy link
Member

amontoison commented Jun 30, 2025

@arnavk23 Please don't add a submodule, it is a breaking change and I am not a big fan of submodules for only two routines.
select was also removed with an old PR and you reintroduce it here with a different API.

Copy link

codecov bot commented Jun 30, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 74.22%. Comparing base (f2ad6a4) to head (865c05e).
Report is 155 commits behind head on main.

Files with missing lines Patch % Lines
src/classification.jl 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #458       +/-   ##
===========================================
- Coverage   89.11%   74.22%   -14.90%     
===========================================
  Files           5        7        +2     
  Lines         790     1672      +882     
===========================================
+ Hits          704     1241      +537     
- Misses         86      431      +345     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@arnavk23 arnavk23 changed the title Add select and select_generator for filtering CUTEst SIF problems filtering CUTEst SIF problems Jun 30, 2025
@arnavk23
Copy link
Contributor Author

arnavk23 commented Jun 30, 2025

@amontoison can you please review, runtests.jl is causing an error.

set_mastsif / list_sif_problems: Error During Test at /tmp/cirrus-ci-build/test/runtests.jl:135
SIF directory not specified and ENV["SIFDIR"] is empty.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] list_sif_problems(; sifdir::Nothing, filter::CUTEst.var"#36#40")
@ CUTEst ~/tmp/cirrus-ci-build/src/classification.jl:259
[3] list_sif_problems()
@ CUTEst ~/tmp/cirrus-ci-build/src/classification.jl:257
[4] macro expansion
@ ~/tmp/cirrus-ci-build/test/runtests.jl:138 [inlined]
[5] macro expansion
@ ~/julia/share/julia/stdlib/v1.11/Test/src/Test.jl:1704 [inlined]
[6] top-level scope
@ ~/tmp/cirrus-ci-build/test/runtests.jl:136
[7] include(fname::String)
@ Main ./sysimg.jl:38
[8] top-level scope
@ none:6
[9] eval
@ ./boot.jl:430 [inlined]
[10] exec_options(opts::Base.JLOptions)
@ Base ./client.jl:296
[11] _start()
@ Base ./client.jl:531
Total Time
set_mastsif / list_sif_problems | 1 1 1.1s
ERROR: Some tests did not pass: 0 passed, 0 failed, 1 errored, 0 broken.
in expression starting at /tmp/cirrus-ci-build/test/runtests.jl:135
ERROR: Package CUTEst errored during testing
Stacktrace:
[1] pkgerror(msg::String)
@ Pkg.Types ~/julia/share/julia/stdlib/v1.11/Pkg/src/Types.jl:68
[2] test(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; coverage::Bool, julia_args::Cmd, test_args::Cmd, test_fn::Nothing, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool)
[3] test
@ test(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; coverage::Bool, test_fn::Nothing, julia_args::Cmd, test_args::Cmd, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool, kwargs::@kwargs{io::IOContext{IO}})
@ Pkg.API ~/julia/share/julia/stdlib/v1.11/Pkg/src/API.jl:481
[5] Pkg.API ~/julia/share/julia/stdlib/v1.11/Pkg/src/API.jl:159
[6] ~/julia/share/julia/stdlib/v1.11/Pkg/src/
[7]top-level scope

@amontoison
Copy link
Member

@arnavk23
It is ENV["MASTSIF"] that you need:
https://github.com/JuliaSmoothOptimizers/CUTEst.jl/blob/main/src/sifdecoder.jl#L10

@arnavk23 arnavk23 changed the title filtering CUTEst SIF problems CUTEst SIF generator Jul 1, 2025
@arnavk23
Copy link
Contributor Author

arnavk23 commented Jul 2, 2025

@amontoison Now all test pass, only codecov showing error as can be seen for 101041f.

@arnavk23 arnavk23 requested a review from amontoison July 5, 2025 08:22
@arnavk23
Copy link
Contributor Author

arnavk23 commented Jul 5, 2025

@amontoison It is should now be passing all the checks.

Copy link
Member

@amontoison amontoison left a comment

Choose a reason for hiding this comment

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

@arnavk23 Can you export the function generator_sif_problems, move the function is classification.jl and add a small unit test for this new function?
Should be good for me after that 👍

@arnavk23
Copy link
Contributor Author

arnavk23 commented Jul 6, 2025

@amontoison can you please explain the above remark a little more

@amontoison
Copy link
Member

amontoison commented Jul 6, 2025

  • add a export generator_sif_problems in src/CUTEst.jl
  • remove the new file src/NLPModels.jl and move the content in the file src/classification.jl
  • add a unit for export generator_sif_problems in test/coverage.jl
  • add an entry for generator_sif_problems in docs/src/classification.md

@arnavk23
Copy link
Contributor Author

arnavk23 commented Jul 6, 2025

@amontoison please review the changes again.

@arnavk23 arnavk23 requested a review from amontoison July 6, 2025 00:58
Copy link
Member

@amontoison amontoison left a comment

Choose a reason for hiding this comment

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

LGTM

@amontoison amontoison merged commit b786b3d into JuliaSmoothOptimizers:main Jul 6, 2025
18 of 20 checks passed
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.

Create select that returns a generator expression
2 participants