Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/background/duality.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ Second, let us see why ``\mathcal{D}_+^{*} = \mathcal{P}_+``.

Since ``A \in \mathcal{D}_+`` implies that ``A^\top \in \mathcal{D}_+``,
``B \in \mathcal{D}_+^{*}`` means that ``\langle A+A^\top,B\rangle \ge 0``
for all ``A \in \mathcal{D}_+``, and hence ``B \in \\mathcal{P}_+``.
for all ``A \in \mathcal{D}_+``, and hence ``B \in \mathcal{P}_+``.

To see why it should be symmetric, simply notice that if ``B_{i,j} < B_{j,i}``,
then ``\langle A,B\rangle`` can be made arbitrarily small by setting
Expand Down
4 changes: 2 additions & 2 deletions docs/src/background/infeasibility_certificates.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ the primal certificate of the variable bounds can be computed using the primal
certificate associated with the affine constraints, ``d``. (Note that ``d`` will
have one element for each row of the ``A`` matrix, and that some or all of the
elements in the vectors ``l_A`` and ``u_A`` may be ``\pm \infty``. If both
``l_A`` and ``u_A`` are finite for some row, the corresponding element in ``d`
must be `0`.)
``l_A`` and ``u_A`` are finite for some row, the corresponding element in ``d``
must be `0`.)

Given ``d``, compute ``\bar{d} = d^\top A``. If the bound is finite, a
certificate for the lower variable bound of ``x_i`` is ``\max\{\bar{d}_i, 0\}``,
Expand Down
4 changes: 2 additions & 2 deletions docs/src/developer/checklists.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Use this checklist when adding a new set to the MathOptInterface repository.
`LinearAlgebra.dot`
- [ ] If an `AbstractVectorSet`, implement `Utilities.set_with_dimension` in
`src/Utilities/matrix_of_constraints.jl`
- [ ] Add the set to the `@model` macro at the bottom of `src/Utilities.model.jl`
- [ ] Add the set to the `@model` macro at the bottom of `src/Utilities/model.jl`

## Documentation

Expand Down Expand Up @@ -142,7 +142,7 @@ Use this checklist when updating the version of MathOptFormat.
- [ ] `set_to_moi` is defined for each set in `src/FileFormats/MOF/read.jl`
- [ ] `head_name` is defined for each set in `src/FileFormats/MOF/write.jl`
- [ ] A new unit test calling `_test_model_equality` is added to
`test/FileFormats/MOF/MOF.jl`
`test/FileFormats/MOF/test_MOF.jl`

## Tests

Expand Down
10 changes: 5 additions & 5 deletions docs/src/developer/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,17 @@
```julia
julia> using Revise

julia> include("test/Nonlinear/runtests.jl")
julia> include("test/Nonlinear/test_Nonlinear.jl")

julia> # make changes to `src/Nonlinear`

julia> include("test/Nonlinear/runtests.jl")
julia> include("test/Nonlinear/test_Nonlinear.jl")
```
You can also run other tests such as `test/Bridges/Constraint/runtests.jl`, or
any individual file, such as `test/Utilities/distance_to_set.jl`.
You can also run other tests such as `test/Bridges/Constraint/test_bridge.jl`,
or `test/Utilities/test_distance_to_set.jl`.

There is one complication: `JSONSchema` is a test-time dependency that is not
present in the default project. If you want to run `test/FileFormats/MOF/MOF.jl`,
present in the default project. If you want to run `test/FileFormats/MOF/test_MOF.jl`,
you will first need to install the package (`Pkg.test("MathOptInterface")` does
this automatically):
```julia
Expand All @@ -117,10 +117,10 @@
When you open a pull request, our automated CI will run all of the tests and
highlight any failing tests that need to be fixed.

A comment from `@odow`: when I'm working on a feature, I make local changes,

Check warning on line 120 in docs/src/developer/contributing.md

View workflow job for this annotation

GitHub Actions / build

[vale] reported by reviewdog 🐶 [Google.FirstPerson] Avoid first-person pronouns such as ' I '. Raw Output: {"message":"[Google.FirstPerson] Avoid first-person pronouns such as ' I '.","location":{"path":"docs/src/developer/contributing.md","range":{"start":{"line":120,"column":55},"end":{"line":120,"column":58}}},"severity":"WARNING","code":{"value":"Google.FirstPerson","url":"https://developers.google.com/style/pronouns#personal-pronouns"}}

Check warning on line 120 in docs/src/developer/contributing.md

View workflow job for this annotation

GitHub Actions / build

[vale] reported by reviewdog 🐶 [Google.FirstPerson] Avoid first-person pronouns such as 'I'm'. Raw Output: {"message":"[Google.FirstPerson] Avoid first-person pronouns such as 'I'm'.","location":{"path":"docs/src/developer/contributing.md","range":{"start":{"line":120,"column":30},"end":{"line":120,"column":33}}},"severity":"WARNING","code":{"value":"Google.FirstPerson","url":"https://developers.google.com/style/pronouns#personal-pronouns"}}
run the most relevant test file with `include`, and then open a PR. If the
change caused a test to fail in some other part of the codebase, I then

Check warning on line 122 in docs/src/developer/contributing.md

View workflow job for this annotation

GitHub Actions / build

[vale] reported by reviewdog 🐶 [Google.FirstPerson] Avoid first-person pronouns such as ' I '. Raw Output: {"message":"[Google.FirstPerson] Avoid first-person pronouns such as ' I '.","location":{"path":"docs/src/developer/contributing.md","range":{"start":{"line":122,"column":65},"end":{"line":122,"column":68}}},"severity":"WARNING","code":{"value":"Google.FirstPerson","url":"https://developers.google.com/style/pronouns#personal-pronouns"}}
`include` the file with the failing test locally to debug my follow-up changes.

Check warning on line 123 in docs/src/developer/contributing.md

View workflow job for this annotation

GitHub Actions / build

[vale] reported by reviewdog 🐶 [Google.FirstPerson] Avoid first-person pronouns such as 'my'. Raw Output: {"message":"[Google.FirstPerson] Avoid first-person pronouns such as 'my'.","location":{"path":"docs/src/developer/contributing.md","range":{"start":{"line":123,"column":59},"end":{"line":123,"column":61}}},"severity":"WARNING","code":{"value":"Google.FirstPerson","url":"https://developers.google.com/style/pronouns#personal-pronouns"}}

## Building the documentation

Expand Down
6 changes: 3 additions & 3 deletions docs/src/manual/solutions.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ non-global tree search solvers like

Some solvers will not implement every solution attribute. Therefore, a call like
`MOI.get(model, MOI.SolveTimeSec())` may throw an [`UnsupportedAttribute`](@ref)
error.
or [`GetAttributeNotAllowed`](@ref) error.

If you need to write code that is agnostic to the solver (for example, you are
writing a library that an end-user passes their choice of solver to), you can
Expand All @@ -145,7 +145,7 @@ function get_solve_time(model)
try
return MOI.get(model, MOI.SolveTimeSec())
catch err
if err isa MOI.UnsupportedAttribute
if err isa Union{MOI.UnsupportedAttribute,MOI.GetAttributeNotAllowed}
return NaN # Solver doesn't support. Return a placeholder value.
end
rethrow(err) # Something else went wrong. Rethrow the error
Expand All @@ -170,7 +170,7 @@ function get_solve_time(model::CachedSolveTime)
try
return MOI.get(model, MOI.SolveTimeSec())
catch err
if err isa MOI.UnsupportedAttribute
if Union{MOI.UnsupportedAttribute,MOI.GetAttributeNotAllowed}
model.supports_solve_time = false
return NaN
end
Expand Down
4 changes: 2 additions & 2 deletions src/Utilities/parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function _parse_function(ex, ::Type{T} = Float64) where {T}
"Unsupported operator in `loadfromstring!`: `$(ex.args[1])`. " *
"The parser is deliberately limited in the syntax it " *
"accepts. Write `x - y` as `x + -1 * y`, and `x^2` as " *
"`x * x`.",
"`1 * x * x`.",
)
end
affine_terms = _ParsedScalarAffineTerm{T}[]
Expand Down Expand Up @@ -367,7 +367,7 @@ Do not name `VariableIndex` constraints.
## Exceptions

* `x - y` does NOT currently parse. Instead, write `x + -1.0 * y`.
* `x^2` does NOT currently parse. Instead, write `x * x`.
* `x^2` does NOT currently parse. Instead, write `1 * x * x`.
"""
function loadfromstring!(model, s)
for string_line in split(s, "\n")
Expand Down
4 changes: 2 additions & 2 deletions src/attributes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1988,7 +1988,7 @@ Optimizers should implement the following methods:
MOI.get(
::Optimizer,
::MOI.ListOfVariablesWithAttributeSet{<:MOI.AbstractVariableAttribute},
)::Vector{MOI.VarialbeIndex}
)::Vector{MOI.VariableIndex}
```
They should not implement [`set`](@ref) or [`supports`](@ref).
"""
Expand Down Expand Up @@ -2274,7 +2274,7 @@ Two constraints may have the same name; however, constraints with duplicate
names cannot be looked up using [`get`](@ref), regardless of whether they have
the same `F`-in-`S` type.

## VariableIndex connstraints
## VariableIndex constraints

You should _not_ implement [`ConstraintName`](@ref) for [`VariableIndex`](@ref)
constraints.
Expand Down
2 changes: 1 addition & 1 deletion test/Utilities/test_parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function test__parse_function()
"Unsupported operator in `loadfromstring!`: `-`. " *
"The parser is deliberately limited in the syntax it " *
"accepts. Write `x - y` as `x + -1 * y`, and `x^2` as " *
"`x * x`.",
"`1 * x * x`.",
)
@test_throws err MOIU._parse_function(:(x - y))

Expand Down
Loading