From 9d09afd0b75bbd3a6b968816b5302074d7d7e813 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Thu, 19 Feb 2026 10:26:37 +1300 Subject: [PATCH] [docs] add changelog --- .gitignore | 11 ++----- docs/make.jl | 66 +++++++++++++++++++++++++++++++++++++- docs/src/changelog.md | 73 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 140 insertions(+), 10 deletions(-) create mode 100644 docs/src/changelog.md diff --git a/.gitignore b/.gitignore index 9390fdf..6137d67 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,4 @@ -docs/build/ -*.jl.cov -*.jl.*.cov -*.jl.mem -deps/deps.jl +docs/build +docs/src/release_notes.md Manifest.toml .DS_Store -test/MOItests.jl -test/quadratic_tests.jl -*.json -*.txt diff --git a/docs/make.jl b/docs/make.jl index 6c0313c..7199c8f 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -6,6 +6,65 @@ import Documenter import ParametricOptInterface +# ============================================================================== +# Modify the release notes +# ============================================================================== + +function fix_release_line( + line::String, + url::String = "https://github.com/jump-dev/ParametricOptInterface.jl", +) + # (#XXXX) -> ([#XXXX](url/issue/XXXX)) + while (m = match(r"\(\#([0-9]+)\)", line)) !== nothing + id = m.captures[1] + line = replace(line, m.match => "([#$id]($url/issues/$id))") + end + # ## Version X.Y.Z -> [Version X.Y.Z](url/releases/tag/vX.Y.Z) + while (m = match(r"\#\# Version ([0-9]+.[0-9]+.[0-9]+)", line)) !== nothing + tag = m.captures[1] + line = replace( + line, + m.match => "## [Version $tag]($url/releases/tag/v$tag)", + ) + end + # ## vX.Y.Z -> [vX.Y.Z](url/releases/tag/vX.Y.Z) + while (m = match(r"\#\# (v[0-9]+.[0-9]+.[0-9]+)", line)) !== nothing + tag = m.captures[1] + line = replace(line, m.match => "## [$tag]($url/releases/tag/$tag)") + end + return line +end + +function _fix_release_lines(changelog, release_notes, args...) + open(release_notes, "w") do io + for line in readlines(changelog; keep = true) + write(io, fix_release_line(line, args...)) + end + end + return +end + +_fix_release_lines( + joinpath(@__DIR__, "src", "changelog.md"), + joinpath(@__DIR__, "src", "release_notes.md"), +) + +function _add_edit_url(filename, url) + contents = read(filename, String) + open(filename, "w") do io + write(io, "```@meta\nEditURL = \"$url\"\n```\n\n") + write(io, contents) + return + end + return +end + +_add_edit_url(joinpath(@__DIR__, "src", "release_notes.md"), "changelog.md") + +# ============================================================================== +# Build and deploy the documentation +# ============================================================================== + Documenter.makedocs(; modules = [ParametricOptInterface], clean = true, @@ -17,7 +76,12 @@ Documenter.makedocs(; ), sitename = "ParametricOptInterface.jl", authors = "Tomás Gutierrez, and contributors", - pages = ["Home" => "index.md", "background.md", "reference.md"], + pages = [ + "Home" => "index.md", + "background.md", + "reference.md", + "release_notes.md", + ], checkdocs = :none, ) diff --git a/docs/src/changelog.md b/docs/src/changelog.md new file mode 100644 index 0000000..81b2703 --- /dev/null +++ b/docs/src/changelog.md @@ -0,0 +1,73 @@ +```@meta +CurrentModule = ParametricOptInterface +``` + +# Release notes + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## Version 0.15.0 (February 19, 2026) + +This breaking release removes a number of ParametricOptInterface-specific +features in favor of the officially supported MathOptInterface functions for +dealing with parameters. + +### Breaking + +- Removed `QuadraticObjectiveCoef` (#213) + + This breaking change removed `QuadraticObjectiveCoef` and all related + functions. + + To represent a parameter multiplied by a quadratic term, you must now use + `MOI.ScalarNonlinearFunction` to define a cubic polynomial: + ```julia + using JuMP, HiGHS + import ParametricOptInterface as POI + model = Model(() -> POI.Optimizer(HiGHS.Ootimizer)) + @variable(model, x) + @variable(model, p in Parameter(1)) + @objective(model, Min, p * x^2) + ``` + +- Removed `ParameterValue` and `ParameterDual` (#219) + + This breaking change removed `ParameterValue` and `ParameterDual` and all + related functions. + + In JuMP, follow these replacements: + ```julia + using JuMP + model = Model() + @variable(model, x) + @variable(model, p in Parameter(1)) + # Replace MOI.get(model, POI.ParameterValue(), p) with + p_value = parameter_value(p) + # Replace MOI.set(model, POI.ParameterValue(), p, 2.0) with + set_parameter_value(p, 2.0) + # Replace MOI.get(model, POI.ParameterDual(), p) with + p_dual = dual(ParameterRef(p)) + ``` + + In MathOptInterface, follow these replacements: + ```julia + import MathOptInterface as MOI + model = MOI.Utilities.Model{Float64}() + p, cp in MOI.add_constrained_variable(model, MOI.Parameter(1.0)) + # Replace MOI.get(model, POI.ParameterValue(), p) with + p_value = MOI.get(model, MOI.ConstraintSet(), cp).value + # Replace MOI.set(model, POI.ParameterValue(), p, 2.0) with + MOI.set(model, MOI.ConstraintSet(), cp, MOI.Parameter(2.0)) + # Replace MOI.get(model, POI.ParameterDual(), p) with + p_dual = MOI.get(model, MOI.ConstraintDual(), cp) + ``` + +### Other + +- Various changes to improve code style (#214) +- Make all of the test optimizers silent (#215) +- Update tests for SCS.jl@2 (#216) +- Make the explanation a separate page (#217) +- Increase coverage (#218) +- Run the benchmarks in CI to ensure they stay updated (#220)