This repository provides a specialized Python-only subset of the S2MPJ collection.
This repository preserves only the files relevant to Python users from the original source. These files are located in the src/ directory:
src/python_problems/: Directory containing the optimization problems converted to Python.src/list_of_python_problems: A listing of all available problems.src/s2mpjlib.py: Supporting library script.
The file config.txt in this directory controls how s2mpj_select filters problems (e.g., variable_size and test_feasibility_problems). See the comments in config.txt for a full description of each option.
When used through OptiProfiler, you can override these options at runtime without editing config.txt:
from optiprofiler import set_plib_config, get_plib_config
# View the current effective configuration
print(get_plib_config('s2mpj'))
# Override at runtime (persists for the current Python process)
set_plib_config('s2mpj', variable_size='all', test_feasibility_problems=2)You can also set the environment variables S2MPJ_VARIABLE_SIZE and S2MPJ_TEST_FEASIBILITY_PROBLEMS directly. Environment variables take precedence over config.txt.
The CI workflow runs daily and on pushes. It checks the OptiProfiler adapter layer by:
- selecting a small set of representative
u,b,l, andnproblems; - loading each selected problem through
s2mpj_load; - evaluating
fun,cub, andceqat the initial point; - checking
variable_sizeandtest_feasibility_problemsenvironment overrides; - sampling a few additional small problems each day with at most two numerical-library threads.
Locally, from this repository:
python -m unittest discover -s tests -p 'test_*.py'This repository is automatically synchronized with the upstream GrattonToint/S2MPJ repository via GitHub Actions. It checks for updates daily to ensure the problem set remains current.
The files under src/ are a filtered Python subset of the upstream S2MPJ repository. This repository adds only the OptiProfiler adapter, metadata, and maintenance workflows. Please follow the upstream S2MPJ citation and license guidance when using the problem collection.
For the full collection or other languages, please visit the original repository.