Skip to content

Commit df0b457

Browse files
authored
[docs] Add Google style guide for Vale and fix errors and warnings (#2110)
1 parent fed2f8b commit df0b457

Some content is hidden

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

47 files changed

+395
-130
lines changed

docs/.vale.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
StylesPath = styles
2-
MinAlertLevel = suggestion
2+
MinAlertLevel = warning
33

44
Vocab = JuMP-Vocab
55

66
[*.md]
7-
BasedOnStyles = Vale
7+
BasedOnStyles = Vale, Google
88

99
# Skip \\token and \token LaTeX commands
1010
TokenIgnores = \\\\[a-z]+, \\[a-z]+, [a-zA-Z]+_[_a-zA-Z]+

docs/src/background/infeasibility_certificates.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ A problem is unbounded if and only if:
7070

7171
A feasible primal solution—if one exists—can be obtained by setting
7272
[`ObjectiveSense`](@ref) to `FEASIBILITY_SENSE` before optimizing. Therefore,
73-
most solvers terminate after they prove the dual is infeasible via a certificate
73+
most solvers stop after they prove the dual is infeasible via a certificate
7474
of dual infeasibility, but _before_ they have found a feasible primal solution.
7575
This is also the reason that MathOptInterface defines the `DUAL_INFEASIBLE`
7676
status instead of `UNBOUNDED`.
@@ -138,9 +138,9 @@ If the solver has found a certificate of primal infeasibility:
138138

139139
### Infeasibility certificates of variable bounds
140140

141-
Many linear solvers (e.g., Gurobi) do not provide explicit access to the primal
142-
infeasibility certificate of a variable bound. However, given a set of linear
143-
constraints:
141+
Many linear solvers (for example, Gurobi) do not provide explicit access to the
142+
primal infeasibility certificate of a variable bound. However, given a set of
143+
linear constraints:
144144
```math
145145
\begin{align}
146146
l_A \le A x \le u_A \\

docs/src/background/motivation.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ To address a number of limitations of MathProgBase, MOI is designed to:
1212
- Be simple and extensible
1313
* unifying linear, quadratic, and conic optimization,
1414
* seamlessly facilitating extensions to essentially arbitrary constraints and
15-
functions (e.g., indicator constraints, complementarity constraints, and
16-
piecewise-linear functions)
15+
functions (for example, indicator constraints, complementarity constraints,
16+
and piecewise-linear functions)
1717
- Be fast
1818
* by allowing access to a solver's in-memory representation of a problem
1919
without writing intermediate files (when possible)
20-
* by using multiple dispatch and avoiding requiring containers of non-concrete
21-
types
22-
- Allow a solver to return multiple results (e.g., a pool of solutions)
23-
- Allow a solver to return extra arbitrary information via attributes (e.g.,
24-
variable- and constraint-wise membership in an irreducible inconsistent subset
25-
for infeasibility analysis)
20+
* by using multiple dispatch and avoiding requiring containers of
21+
non-concrete types
22+
- Allow a solver to return multiple results (for example, a pool of solutions)
23+
- Allow a solver to return extra arbitrary information via attributes (for
24+
example, variable- and constraint-wise membership in an irreducible
25+
inconsistent subset for infeasibility analysis)
2626
- Provide a greatly expanded set of status codes explaining what happened during
2727
the optimization procedure
2828
- Enable a solver to more precisely specify which problem classes it supports

docs/src/background/naming_conventions.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ Sets encode the structure of constraints. Their names should follow the
1717
following conventions:
1818

1919
* Abstract types in the set hierarchy should begin with `Abstract` and end in
20-
`Set`, e.g., [`AbstractScalarSet`](@ref), [`AbstractVectorSet`](@ref).
21-
* Vector-valued conic sets should end with `Cone`, e.g.,
20+
`Set`, for example, [`AbstractScalarSet`](@ref), [`AbstractVectorSet`](@ref).
21+
* Vector-valued conic sets should end with `Cone`, for example,
2222
[`NormInfinityCone`](@ref), [`SecondOrderCone`](@ref).
2323
* Vector-valued Cartesian products should be plural and not end in `Cone`,
24-
e.g., [`Nonnegatives`](@ref), not `NonnegativeCone`.
24+
for example, [`Nonnegatives`](@ref), not `NonnegativeCone`.
2525
* Matrix-valued conic sets should provide two representations: `ConeSquare` and
26-
`ConeTriangle`, e.g., [`RootDetConeTriangle`](@ref) and
26+
`ConeTriangle`, for example, [`RootDetConeTriangle`](@ref) and
2727
[`RootDetConeSquare`](@ref). See [Matrix cones](@ref) for more details.
28-
* Scalar sets should be singular, not plural, e.g., [`Integer`](@ref), not
29-
`Integers`.
28+
* Scalar sets should be singular, not plural, for example, [`Integer`](@ref),
29+
not `Integers`.
3030
* As much as possible, the names should follow established conventions in the
3131
domain where this set is used: for instance, convex sets should have names
3232
close to those of [CVX](http://web.cvxr.com/cvx/doc/), and

docs/src/changelog.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ removed, similar to how Julia 1.0 was Julia 0.7 with deprecations removed.
416416
### Troubleshooting problems when updating
417417

418418
If you experience problems when updating, you are likely using previously
419-
deprecated functionality. (By default, Julia does not warn when you use
419+
deprecated features. (By default, Julia does not warn when you use
420420
deprecated features.)
421421

422422
To find the deprecated features you are using, start Julia with `--depwarn=yes`:
@@ -1115,7 +1115,7 @@ This release contains backports from the ongoing development of the v0.10 releas
11151115
## v0.8.0 (December 18, 2018)
11161116

11171117
- Rename all enum values to follow the JuMP naming guidelines for constants,
1118-
e.g., `Optimal` becomes `OPTIMAL`, and `DualInfeasible` becomes
1118+
for example, `Optimal` becomes `OPTIMAL`, and `DualInfeasible` becomes
11191119
`DUAL_INFEASIBLE`.
11201120
- Rename CachingOptimizer methods for style compliance.
11211121
- Add an `MOI.TerminationStatusCode` called `ALMOST_DUAL_INFEASIBLE`.
@@ -1204,10 +1204,10 @@ This release contains backports from the ongoing development of the v0.10 releas
12041204
- Add test for empty rows in vector linear constraint.
12051205
- Rework errors: `CannotError` has been renamed `NotAllowedError` and
12061206
the distinction between `UnsupportedError` and `NotAllowedError` is now
1207-
about whether the element is not supported (i.e. it cannot be copied a
1207+
about whether the element is not supported (for example, it cannot be copied a
12081208
model containing this element) or the operation is not allowed (either
12091209
because it is not implemented, because it cannot be performed in the current
1210-
state of the model, because it cannot be performed for a specific index, ...)
1210+
state of the model, or because it cannot be performed for a specific index)
12111211
- `canget` is removed. `NoSolution` is added as a result status to indicate
12121212
that the solver does not have either a primal or dual solution available
12131213
(See #479).

docs/src/manual/constraints.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ nonpositive) real numbers.
112112
| ``Ax + b = 0`` | `VectorAffineFunction` | `Zeros` |
113113

114114
By convention, solvers are not expected to support nonzero constant terms in the
115-
[`ScalarAffineFunction`](@ref)s the first four rows above, because they are
116-
redundant with the parameters of the sets. For example, encode ``2x + 1 \le 2``
117-
as ``2x \le 1``.
115+
[`ScalarAffineFunction`](@ref)s the first four rows of the preceding table
116+
because they are redundant with the parameters of the sets. For example, encode
117+
``2x + 1 \le 2`` as ``2x \le 1``.
118118

119119
Constraints with [`VariableIndex`](@ref) in [`LessThan`](@ref), [`GreaterThan`](@ref),
120120
[`EqualTo`](@ref), or [`Interval`](@ref) sets have a natural interpretation as
@@ -195,7 +195,7 @@ Variable bounds are handled in a similar fashion:
195195
- `@variable(m, x >= 1)` becomes `VariableIndex`-in-`GreaterThan`
196196

197197
One notable difference is that a variable with an upper and lower bound is
198-
translated into two constraints, rather than an interval. i.e.:
198+
translated into two constraints, rather than an interval, that is:
199199

200200
- `@variable(m, 0 <= x <= 1)` becomes `VariableIndex`-in-`LessThan` *and*
201201
`VariableIndex`-in-`GreaterThan`.

docs/src/manual/models.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ DocTestFilters = [r"MathOptInterface|MOI"]
99
# Models
1010

1111
The most significant part of MOI is the definition of the **model API** that is
12-
used to specify an instance of an optimization problem (e.g., by adding
12+
used to specify an instance of an optimization problem (for example, by adding
1313
variables and constraints). Objects that implement the model API must inherit
1414
from the [`ModelLike`](@ref) abstract type.
1515

1616
Notably missing from the model API is the method to solve an optimization
17-
problem. `ModelLike` objects may store an instance (e.g., in memory or backed by
18-
a file format) without being linked to a particular solver. In addition to the
19-
model API, MOI defines [`AbstractOptimizer`](@ref) and provides methods to solve
20-
the model and interact with solutions. See the [Solutions](@ref manual_solutions)
21-
section for more details.
17+
problem. `ModelLike` objects may store an instance (for example, in memory or
18+
backed by a file format) without being linked to a particular solver. In
19+
addition to the model API, MOI defines [`AbstractOptimizer`](@ref) and provides
20+
methods to solve the model and interact with solutions. See the
21+
[Solutions](@ref manual_solutions) section for more details.
2222

2323
!!! info
2424
Throughout the rest of the manual, `model` is used as a generic `ModelLike`,

docs/src/manual/modification.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ constraint (for example, from [`LessThan`](@ref) to [`GreaterThan`](@ref)). For
5757
these cases, MathOptInterface provides the [`transform`](@ref) method.
5858

5959
The [`transform`](@ref) function returns a new constraint index, and the old
60-
constraint index (i.e., `c`) is no longer valid.
60+
constraint index (that is, `c`) is no longer valid.
6161

6262
```jldoctest transform_set; setup=:(model = MOI.Utilities.Model{Float64}(); x = MOI.add_variable(model))
6363
julia> c = MOI.add_constraint(
@@ -129,10 +129,8 @@ julia> MOI.get(model, MOI.ConstraintFunction(), c) ≈ new_f
129129
true
130130
```
131131

132-
!!! tip
133-
[`ScalarConstantChange`](@ref) can also be used to modify the objective
134-
function by passing an instance of [`ObjectiveFunction`](@ref) instead of
135-
the constraint index `c` as we saw above.
132+
[`ScalarConstantChange`](@ref) can also be used to modify the objective
133+
function by passing an instance of [`ObjectiveFunction`](@ref):
136134

137135
```jldoctest scalar_constant_change
138136
julia> MOI.set(
@@ -207,10 +205,8 @@ julia> MOI.get(model, MOI.ConstraintFunction(), c) ≈ new_f
207205
true
208206
```
209207

210-
!!! tip
211-
[`ScalarCoefficientChange`](@ref) can also be used to modify the objective
212-
function by passing an instance of [`ObjectiveFunction`](@ref) instead of
213-
the constraint index `c` as we saw above.
208+
[`ScalarCoefficientChange`](@ref) can also be used to modify the objective
209+
function by passing an instance of [`ObjectiveFunction`](@ref).
214210

215211
## Modify affine coefficients in a vector function
216212

docs/src/manual/solutions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ MOI.optimize!(optimizer)
1919

2020
## Why did the solver stop?
2121

22-
The optimization procedure may terminate for a number of reasons. The
22+
The optimization procedure may stop for a number of reasons. The
2323
[`TerminationStatus`](@ref) attribute of the optimizer returns a
2424
[`TerminationStatusCode`](@ref) object which explains why the solver stopped.
2525

docs/src/manual/standard_form.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ The function types implemented in MathOptInterface.jl are:
3434

3535
| Function | Description |
3636
| :--------------- | :---------- |
37-
| [`VariableIndex`](@ref) | ``x_j``, i.e., projection onto a single coordinate defined by a variable index ``j``. |
38-
| [`VectorOfVariables`](@ref) | The projection onto multiple coordinates (i.e., extracting a sub-vector). |
37+
| [`VariableIndex`](@ref) | ``x_j``, the projection onto a single coordinate defined by a variable index ``j``. |
38+
| [`VectorOfVariables`](@ref) | The projection onto multiple coordinates (that is, extracting a sub-vector). |
3939
| [`ScalarAffineFunction`](@ref) | ``a^T x + b``, where ``a`` is a vector and ``b`` scalar. |
4040
| [`VectorAffineFunction`](@ref) | ``A x + b``, where ``A`` is a matrix and ``b`` is a vector. |
4141
| [`ScalarQuadraticFunction`](@ref) | ``\frac{1}{2} x^T Q x + a^T x + b``, where ``Q`` is a symmetric matrix, ``a`` is a vector, and ``b`` is a constant. |

0 commit comments

Comments
 (0)