Skip to content

Commit 14d09eb

Browse files
tmigotBenjaminPINEAU
authored andcommitted
Move doc from comments to meta (JuliaSmoothOptimizers#407)
* Move doc from comments to meta (aircrfta) * up * do not move license * add new fields in Meta * Move comments to META * fix * add refs * move things around hs * add doc * Add a bib creator * fix * fix conflict * allow multiple URL * fill-in meta * up some refs * clean COPS test problems * clean HS2 * Fix split :origin and :origin_notes * Add missing bibtex and links * Add lib ref * small fixes * 59 files with http://dx.doi.org/https://doi.org/ * Update SKILL * uniform bib
1 parent a06408f commit 14d09eb

773 files changed

Lines changed: 13293 additions & 5738 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills/find-bib/SKILL.md

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
---
2+
name: find-bib
3+
description: Find or construct a BibTeX reference for an OptimizationProblems.jl meta file. Given a DOI, problem name, or free-form reference text, searches for the DOI online, fetches BibTeX from doi2bib.org, and formats the result as a Julia raw string ready to paste into src/Meta/<name>.jl.
4+
argument-hint: <problem-name | DOI | "free-form reference text">
5+
allowed-tools: [Read, Glob, Grep, WebSearch, WebFetch]
6+
---
7+
8+
# find-bib
9+
10+
Find or construct a BibTeX reference and format it as a Julia raw string for `src/Meta/<name>.jl`.
11+
12+
## Arguments
13+
14+
The user invoked this skill with: $ARGUMENTS
15+
16+
This can be:
17+
- A **problem name** from `src/Meta/` (e.g. `zangwil3`, `hs1`) — skill will read the file and extract context
18+
- A **DOI** (e.g. `10.1145/355934.355936` or `https://doi.org/10.1145/355934.355356`)
19+
- **Free-form reference text** (title, authors, journal, year — quoted or unquoted)
20+
- **Empty** — if no argument is given, ask the user to specify a problem name or reference
21+
22+
---
23+
24+
## Instructions
25+
26+
Follow these steps in order.
27+
28+
### Step 1 — Gather source material
29+
30+
If `$ARGUMENTS` looks like a problem name (no spaces, no slashes, exists as `src/Meta/<name>.jl`):
31+
- Read `src/Meta/$ARGUMENTS.jl`
32+
- Extract `:url`, `:notes`, `:origin_notes`, and the existing `:reference` field (may be empty)
33+
- Use this text as the source for Steps 2–4
34+
35+
Otherwise, treat `$ARGUMENTS` directly as a DOI or free-form reference text.
36+
37+
### Step 2 — Extract or find a DOI
38+
39+
1. Regex-scan all gathered text for a DOI pattern: `10\.\d{4,}/\S+`
40+
- DOIs appear in `:url`, `:notes`, `:origin_notes`, or in the argument itself
41+
2. If no DOI is found, run a **WebSearch** to locate one:
42+
- Try: `"<title or key terms>" "<first author>" DOI`
43+
- Try: `site:doi.org "<title or key terms>"`
44+
- Try CrossRef: `site:search.crossref.org "<title or key terms>"`
45+
3. Extract the DOI string from any search result that contains one.
46+
47+
### Step 3 — Fetch BibTeX
48+
49+
If a DOI was found (say `10.1145/355934.355936`), try these endpoints in order:
50+
51+
1. **CrossRef** (primary): `https://api.crossref.org/works/10.1145/355934.355936/transform/application/x-bibtex`
52+
2. **doi2bib.org** (fallback): `https://www.doi2bib.org/bib/10.1145/355934.355936`
53+
54+
The response is plain-text BibTeX — clean up whitespace if needed, then apply these normalizations:
55+
56+
- **Citation key**: CrossRef often returns auto-generated keys like `More_1981` or `more1981testingunconstrained`. Always rename the key to the `Author1Author2YYYY` format described in Step 4 (e.g. `MoreGarbowHillstrom1981`).
57+
- **`pages` field**: normalize to BibTeX double-hyphen. Replace Unicode en-dash `` or a single hyphen `-` between page numbers with `--` (e.g. `175--184`).
58+
59+
If both endpoints fail or return an error, fall through to Step 4.
60+
61+
### Step 4 — Construct BibTeX manually (fallback)
62+
63+
If no DOI was found or doi2bib.org failed, construct the best possible BibTeX from all available information.
64+
65+
Choose the entry type:
66+
67+
| Type | Use when |
68+
|---|---|
69+
| `@article` | journal or conference paper |
70+
| `@book` | book or edited volume |
71+
| `@techreport` | institutional or technical report |
72+
| `@misc` | dataset, software, website, or unclear |
73+
74+
**Citation key format:** `Author1Author2YYYY` using last names only (e.g. `MoreGarbowHillstrom1981`, `HockSchittkowski1981`). For a single author: `AuthorYYYY`. For institutional authors use a compact CamelCase form (e.g. `NISTStRD`).
75+
76+
**`pages` field:** always use double-hyphen: `175--184`. Convert Unicode en-dash ``, em-dash ``, or single hyphen `-` between page numbers to `--`.
77+
78+
**LaTeX encoding for special characters:** `Mor{\'e}`, `{\'E}`, etc.
79+
80+
**Flag uncertain fields** with a trailing `% UNVERIFIED` comment on that line.
81+
82+
### Step 5 — Present the result
83+
84+
Show three things:
85+
86+
**1. Status line** — one sentence: whether the DOI was found, and from where.
87+
88+
**2. The BibTeX entry** in a code block:
89+
```bibtex
90+
@article{AuthorYear,
91+
author = {Last, First and Last2, First2},
92+
title = {Title of the Article},
93+
journal = {Journal Name},
94+
year = {YYYY},
95+
volume = {V},
96+
number = {N},
97+
pages = {P1--P2},
98+
doi = {10.xxxx/xxxxx}
99+
}
100+
```
101+
102+
**3. The Julia snippet** ready to paste into `src/Meta/<name>.jl`:
103+
```julia
104+
:reference => raw"""
105+
@article{AuthorYear,
106+
author = {Last, First and Last2, First2},
107+
title = {Title of the Article},
108+
journal = {Journal Name},
109+
year = {YYYY},
110+
volume = {V},
111+
number = {N},
112+
pages = {P1--P2},
113+
doi = {10.xxxx/xxxxx}
114+
}
115+
""",
116+
```
117+
118+
### Step 6 — Suggest next steps
119+
120+
- List any fields marked `% UNVERIFIED` that the user should check manually.
121+
- If a DOI was found and the file's `:url` field does not already contain it, suggest adding `https://doi.org/<DOI>` to `:url`. The `:url` field supports multiple URLs as a **comma-separated string**. If a URL is already present, append the new one: `"https://existing.url, https://doi.org/<DOI>"`.
122+
- If the problem name was given, name the exact file to edit: `src/Meta/<name>.jl`.
123+
124+
---
125+
126+
## BibTeX type templates (reference)
127+
128+
```bibtex
129+
@article{AuthorYear,
130+
author = {Last, First},
131+
title = {Title},
132+
journal = {Journal},
133+
year = {YYYY},
134+
volume = {V},
135+
number = {N},
136+
pages = {P1--P2},
137+
doi = {10.xxxx/xxxxx}
138+
}
139+
140+
@book{AuthorYear,
141+
author = {Last, First},
142+
title = {Book Title},
143+
publisher = {Publisher},
144+
address = {City},
145+
year = {YYYY}
146+
}
147+
148+
@techreport{AuthorYear,
149+
author = {Last, First},
150+
title = {Report Title},
151+
institution = {Institution},
152+
number = {Report Number},
153+
year = {YYYY}
154+
}
155+
156+
@misc{AuthorYear,
157+
author = {Last, First},
158+
title = {Title},
159+
year = {YYYY},
160+
howpublished = {\url{https://...}}
161+
}
162+
```

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
*.jl.*.cov
33
*.jl.mem
44
Manifest.toml
5+
*.bib
6+
*/settings.local.json
57
.DS_Store

docs/src/contributing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Here is a to-do list, to help you add new problems:
2222
In both cases, the function must have the same name `problem_name` as the file.
2323
The function should be only exported from `src/ADNLPProblems/problem_name.jl` and `src/PureJuMP/problem_name.jl`.
2424
* When submitting a problem, please pay particular attention to the documentation. We would like to gather as much information as possible on the provenance of problems, other problem sets where the problems are present, and general information on the problem.
25-
The documentation should be added to the file in the `PureJuMP` folder.
26-
* New problems can be scalable, see [ADNLPProblems/arglina.jl](https://github.com/JuliaSmoothOptimizers/OptimizationProblems.jl/blob/main/src/ADNLPProblems/arglina.jl) and [PureJuMP/arglina.jl](https://github.com/JuliaSmoothOptimizers/OptimizationProblems.jl/blob/main/src/PureJuMP/arglina.jl) for examples. In that case, the first keyword parameter should be the number of variables `n::Int` and have the default value `default_nvar` (constant predefined in the module). If your problem has restrictions on the number of variables, e.g., `n` should be odd, or `n` should have the form `4k + 3`, then, instead of throwing errors when the restrictions are not satisfied, you should instead use the number of variables to be as close to `n` as possible. For example, if you want `n` odd and `n = 100` is passed, you can internally convert to `n = 99`. If you want `n = 4k + 3`, and `n = 100` is passed, then compute `k = round(Int, (n - 3) / 4)` and update `n`. When such an internal adjustment is made, emit a warning indicating the requested `n` and the effective value used.
25+
The documentation should be added to the corresponding fields in the `Meta` folder.
26+
* New problems can be scalable, see [ADNLPProblems/arglina.jl](https://github.com/JuliaSmoothOptimizers/OptimizationProblems.jl/blob/main/src/ADNLPProblems/arglina.jl) and [PureJuMP/arglina.jl](https://github.com/JuliaSmoothOptimizers/OptimizationProblems.jl/blob/main/src/PureJuMP/arglina.jl) for examples. In that case, the first keyword parameter should be the number of variables `n::Int` and have the default value `default_nvar` (constant predefined in the module). If your problem has restrictions on the number of variables, e.g., `n` should be odd, or `n` should have the form `4k + 3`, then, instead of throwing errors when the restrictions are not satisfied, you should instead use the number of variables to be as close to `n` as possible. For example, if you want `n` odd and `n = 100` is passed, you can internally convert to `n = 99`. If you want `n = 4k + 3`, and `n = 100` is passed, then compute `k = round(Int, (n - 3) / 4)` and update `n`.
2727
* A first version of the `meta` can be generated using `generate_meta`. A `String` is returned that can be copy-pasted into the `Meta` folder, and then edited.
2828

2929
```julia

docs/src/meta.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,52 @@ OptimizationProblems.get_lanczos1_nls_nequ()
5959
To filter all NLS problems in the metadata DataFrame:
6060
```@example 1
6161
nls_problems = OptimizationProblems.meta[OptimizationProblems.meta.objtype .== :least_squares, :name]
62-
```
62+
```
63+
64+
### Test-set membership (`:lib`)
65+
66+
The `:lib` column records membership in named optimization test-set collections.
67+
Each entry is a comma-separated list of `"Collection:ID"` pairs; an empty string
68+
means the problem has no known test-set membership.
69+
70+
```@example 1
71+
OptimizationProblems.hs1_meta[:lib] # "CUTEst:HS1, HS:1"
72+
```
73+
74+
Known collections (keys of `OptimizationProblems.LIB_REFERENCES`):
75+
76+
| Key | Description |
77+
|-----|-------------|
78+
| `AMPGO` | Gavana's Global Optimization benchmark suite |
79+
| `COPS` | COPS 3.0 collection (Dolan & Moré, 2004) |
80+
| `CUTEst` | CUTEst testing environment (Gould et al., 2015) |
81+
| `HS` | Hock & Schittkowski (1981), Vol. 187 |
82+
| `HS2` | Schittkowski (1987), Vol. 282 |
83+
| `Luksan` | Luksan, Matonoha & Vlček (2003) — Modified CUTE problems |
84+
| `LuksanSparse` | Luksan, Matonoha & Vlček (2010) — Sparse test problems |
85+
| `MGH` | Moré, Garbow & Hillstrom (1981) |
86+
| `NIST` | NIST/ITL Statistical Reference Datasets |
87+
88+
To filter by collection, use Julia's `contains` function:
89+
90+
```@example 1
91+
meta = OptimizationProblems.meta
92+
cops_problems = meta[contains.(meta.lib, "COPS"), [:name, :lib]]
93+
```
94+
95+
```@example 1
96+
cutest_problems = meta[contains.(meta.lib, "CUTEst"), [:name, :lib]]
97+
```
98+
99+
`OptimizationProblems.LIB_REFERENCES` provides the canonical BibTeX entry for
100+
each collection, and [`export_bibtex`](@ref) automatically appends them when
101+
`include_lib_refs = true` (the default).
102+
103+
## Problem'source information
104+
105+
The following code will create a .bib file regrouping all the BibTex citations.
106+
```julia
107+
using OptimizationProblems
108+
export_bibtex()
109+
```
110+
Fields documenting the origin of the problem may be incomplete and any help is welcome.

src/Meta/AMPGO02.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,26 @@ AMPGO02_meta = Dict(
1717
:defined_everywhere => missing,
1818
:origin => :unknown,
1919
:implementation => :both,
20+
:url => "http://infinity77.net/global_optimization/test_functions_1d.html#d-test-functions",
21+
:notes => raw"""
22+
A one dimensional optimization problem
23+
""",
24+
:origin_notes => raw"""
25+
Problem 2 in
26+
http://infinity77.net/global_optimization/test_functions_1d.html#d-test-functions
27+
Andrea Gavana
28+
S. Goyette, Sherbrooke 2016/2017
29+
""",
30+
:reference => raw"""
31+
@misc{GavanaGOTestSuite,
32+
author = {Gavana, Andrea},
33+
title = {Global Optimization Benchmarks},
34+
year = {2013},
35+
howpublished = {\url{http://infinity77.net/global_optimization/}},
36+
note = {Collection of benchmark functions and algorithm comparisons for global optimization (including AMPGO)}
37+
}
38+
""",
39+
:lib => "AMPGO:2",
2040
)
2141
get_AMPGO02_nvar(; n::Integer = default_nvar, kwargs...) = 1
2242
get_AMPGO02_ncon(; n::Integer = default_nvar, kwargs...) = 0

src/Meta/AMPGO03.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,26 @@ AMPGO03_meta = Dict(
1717
:defined_everywhere => missing,
1818
:origin => :unknown,
1919
:implementation => :both,
20+
:url => "http://infinity77.net/global_optimization/test_functions_1d.html#d-test-functions",
21+
:notes => raw"""
22+
A one dimensional optimization problem
23+
""",
24+
:origin_notes => raw"""
25+
Problem 3 in
26+
http://infinity77.net/global_optimization/test_functions_1d.html#d-test-functions
27+
Andrea Gavana
28+
S. Goyette, Sherbrooke 2016/2017
29+
""",
30+
:reference => raw"""
31+
@misc{GavanaGOTestSuite,
32+
author = {Gavana, Andrea},
33+
title = {Global Optimization Benchmarks},
34+
year = {2013},
35+
howpublished = {\url{http://infinity77.net/global_optimization/}},
36+
note = {Collection of benchmark functions and algorithm comparisons for global optimization (including AMPGO)}
37+
}
38+
""",
39+
:lib => "AMPGO:3",
2040
)
2141
get_AMPGO03_nvar(; n::Integer = default_nvar, kwargs...) = 1
2242
get_AMPGO03_ncon(; n::Integer = default_nvar, kwargs...) = 0

src/Meta/AMPGO04.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,26 @@ AMPGO04_meta = Dict(
1717
:defined_everywhere => missing,
1818
:origin => :unknown,
1919
:implementation => :both,
20+
:url => "http://infinity77.net/global_optimization/test_functions_1d.html#d-test-functions",
21+
:notes => raw"""
22+
A one dimensional optimization problem
23+
""",
24+
:origin_notes => raw"""
25+
Problem 4 in
26+
http://infinity77.net/global_optimization/test_functions_1d.html#d-test-functions
27+
Andrea Gavana
28+
S. Goyette, Sherbrooke 2016/2017
29+
""",
30+
:reference => raw"""
31+
@misc{GavanaGOTestSuite,
32+
author = {Gavana, Andrea},
33+
title = {Global Optimization Benchmarks},
34+
year = {2013},
35+
howpublished = {\url{http://infinity77.net/global_optimization/}},
36+
note = {Collection of benchmark functions and algorithm comparisons for global optimization (including AMPGO)}
37+
}
38+
""",
39+
:lib => "AMPGO:4",
2040
)
2141
get_AMPGO04_nvar(; n::Integer = default_nvar, kwargs...) = 1
2242
get_AMPGO04_ncon(; n::Integer = default_nvar, kwargs...) = 0

src/Meta/AMPGO05.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,26 @@ AMPGO05_meta = Dict(
1717
:defined_everywhere => missing,
1818
:origin => :unknown,
1919
:implementation => :both,
20+
:url => "http://infinity77.net/global_optimization/test_functions_1d.html#d-test-functions",
21+
:notes => raw"""
22+
A one dimensional optimization problem
23+
""",
24+
:origin_notes => raw"""
25+
Problem 5 in
26+
http://infinity77.net/global_optimization/test_functions_1d.html#d-test-functions
27+
Andrea Gavana
28+
S. Goyette, Sherbrooke 2016/2017
29+
""",
30+
:reference => raw"""
31+
@misc{GavanaGOTestSuite,
32+
author = {Gavana, Andrea},
33+
title = {Global Optimization Benchmarks},
34+
year = {2013},
35+
howpublished = {\url{http://infinity77.net/global_optimization/}},
36+
note = {Collection of benchmark functions and algorithm comparisons for global optimization (including AMPGO)}
37+
}
38+
""",
39+
:lib => "AMPGO:5",
2040
)
2141
get_AMPGO05_nvar(; n::Integer = default_nvar, kwargs...) = 1
2242
get_AMPGO05_ncon(; n::Integer = default_nvar, kwargs...) = 0

src/Meta/AMPGO06.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,26 @@ AMPGO06_meta = Dict(
1717
:defined_everywhere => missing,
1818
:origin => :unknown,
1919
:implementation => :both,
20+
:url => "http://infinity77.net/global_optimization/test_functions_1d.html#d-test-functions",
21+
:notes => raw"""
22+
A one dimensional optimization problem
23+
""",
24+
:origin_notes => raw"""
25+
Problem 6 in
26+
http://infinity77.net/global_optimization/test_functions_1d.html#d-test-functions
27+
Andrea Gavana
28+
S. Goyette, Sherbrooke 2016/2017
29+
""",
30+
:reference => raw"""
31+
@misc{GavanaGOTestSuite,
32+
author = {Gavana, Andrea},
33+
title = {Global Optimization Benchmarks},
34+
year = {2013},
35+
howpublished = {\url{http://infinity77.net/global_optimization/}},
36+
note = {Collection of benchmark functions and algorithm comparisons for global optimization (including AMPGO)}
37+
}
38+
""",
39+
:lib => "AMPGO:6",
2040
)
2141
get_AMPGO06_nvar(; n::Integer = default_nvar, kwargs...) = 1
2242
get_AMPGO06_ncon(; n::Integer = default_nvar, kwargs...) = 0

src/Meta/AMPGO07.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,26 @@ AMPGO07_meta = Dict(
1717
:defined_everywhere => missing,
1818
:origin => :unknown,
1919
:implementation => :both,
20+
:url => "http://infinity77.net/global_optimization/test_functions_1d.html#d-test-functions",
21+
:notes => raw"""
22+
A one dimensional optimization problem
23+
""",
24+
:origin_notes => raw"""
25+
Problem 7 in
26+
http://infinity77.net/global_optimization/test_functions_1d.html#d-test-functions
27+
Andrea Gavana
28+
S. Goyette, Sherbrooke 2016/2017
29+
""",
30+
:reference => raw"""
31+
@misc{GavanaGOTestSuite,
32+
author = {Gavana, Andrea},
33+
title = {Global Optimization Benchmarks},
34+
year = {2013},
35+
howpublished = {\url{http://infinity77.net/global_optimization/}},
36+
note = {Collection of benchmark functions and algorithm comparisons for global optimization (including AMPGO)}
37+
}
38+
""",
39+
:lib => "AMPGO:7",
2040
)
2141
get_AMPGO07_nvar(; n::Integer = default_nvar, kwargs...) = 1
2242
get_AMPGO07_ncon(; n::Integer = default_nvar, kwargs...) = 0

0 commit comments

Comments
 (0)