Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] add Google style rules to Vale and fix warnings #3285

Merged
merged 2 commits into from
Mar 17, 2023
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
12 changes: 8 additions & 4 deletions docs/.vale.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
StylesPath = styles
MinAlertLevel = suggestion
MinAlertLevel = warning

Vocab = JuMP-Vocab

[*.md]
BasedOnStyles = Vale

TokenIgnores = \$.+?\$, \]\(@(ref|id).+?\)
BasedOnStyles = Vale ; TODO enable Google
TokenIgnores = \
\$.+?\$, \
\]\(@(ref|id).+?\)
; TODO: A couple of escapes to ignore
; AMPL: A, \
; \(2nd
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Ipopt = "=1.1.0"
JSON = "0.21"
JSONSchema = "1"
Literate = "2.8"
MathOptInterface = "=1.13.0"
MathOptInterface = "=1.13.1"
MultiObjectiveAlgorithms = "=0.1.3"
Plots = "1"
SCS = "=1.1.3"
Expand Down
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ function _add_moi_pages()
!!! warning
This documentation in this section is a copy of the official
MathOptInterface documentation available at
[https://jump.dev/MathOptInterface.jl/v1.13.0](https://jump.dev/MathOptInterface.jl/v1.13.0).
[https://jump.dev/MathOptInterface.jl/v1.13.1](https://jump.dev/MathOptInterface.jl/v1.13.1).
It is included here to make it easier to link concepts between JuMP and
MathOptInterface.
"""
Expand Down
6 changes: 3 additions & 3 deletions docs/src/background/algebraic_modeling_languages.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@ julia> nonalgebraic_knapsack([1, 2], [0.5, 0.5], 1.25)
2.0
```

Hopefully you agree that the macro version is much easier to read!
Hopefully you agree that the macro version is much easier to read.

### Part III: JuMP to MathOptInterface

In the third step, JuMP converts the functional form of the problem, i.e.,
In the third step, JuMP converts the functional form of the problem, that is,
`nonalgebraic_knapsack`, into the MathOptInterface API:
```jldoctest
julia> import MathOptInterface as MOI
Expand Down Expand Up @@ -234,7 +234,7 @@ formulation that we started with.
### Step IV: MathOptInterface to HiGHS

As a final step, the [HiGHS.jl](https://github.com/jump-dev/HiGHS.jl) package
converts the MathOptInterface form, i.e., `mathoptinterface_knapsack`, into a
converts the MathOptInterface form, that is, `mathoptinterface_knapsack`, into a
HiGHS-specific API:
```jldoctest
julia> using HiGHS
Expand Down
40 changes: 20 additions & 20 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ The breaking changes are as follows:
warning. This catches a common error in which users write
`@variable(model, x[length(S)])` instead of
`@variable(model, x[1:length(S)])`.
* The `caching_mode` argument to `Model`, e.g.,
* The `caching_mode` argument to `Model`, for example,
`Model(caching_mode = MOIU.MANUAL)` mode has been removed. For more control
over the optimizer, use `direct_model` instead.
* The previously deprecated `lp_objective_perturbation_range` and
Expand Down Expand Up @@ -648,7 +648,7 @@ The breaking changes are as follows:
* Added `unsafe_backend` for querying the inner-most optimizer of a JuMP
model.
* Nonlinear parameters now support the plural `@NLparameters` macro.
* Containers (e.g., `DenseAxisArray`) can now be used in vector-valued
* Containers (for example, `DenseAxisArray`) can now be used in vector-valued
constraints.

### Other
Expand Down Expand Up @@ -692,7 +692,7 @@ The breaking changes are as follows:

* Fixed bug in `rad2deg` and `deg2rad` in nonlinear expressions.
* Fixed a MethodError bug in `Containers` when forcing container type.
* Allow partial slicing of a DenseAxisArray, resolving an issue from 2014!
* Allow partial slicing of a DenseAxisArray, resolving an issue from 2014.
* Fixed a bug printing variable names in IJulia.
* Ending an IJulia cell with `model` now prints a summary of the model (like
in the REPL) not the latex formulation. Use `print(model)` to print the latex
Expand Down Expand Up @@ -948,7 +948,7 @@ The breaking changes are as follows:
- Solvers are no longer added to a model via `Model(solver = XXX(kwargs...))`.
Instead use `Model(with_optimizer(XXX, kwargs...))`. For example, `Model(with_optimizer(Gurobi.Optimizer, OutputFlag=0))`.

- JuMP containers (e.g., the objects returned by `@variable`) have been
- JuMP containers (for example, the objects returned by `@variable`) have been
redesigned. `Containers.SparseAxisArray` replaces `JuMPDict`, `JuMPArray` was
rewritten (inspired by `AxisArrays`) and renamed `Containers.DenseAxisArray`,
and you can now request a container type with the `container=` keyword to the
Expand All @@ -960,7 +960,7 @@ The breaking changes are as follows:
values
[here](https://www.juliaopt.org/MathOptInterface.jl/stable/apireference.html#Termination-Status-1).
The MOI statuses are much richer than the MPB statuses and can be used to
distinguish between previously indistinguishable cases (e.g. did the solver
distinguish between previously indistinguishable cases (for example, did the solver
have a feasible solution when it stopped because of the time limit?).

- Starting values are separate from result values. Use `value` to query
Expand Down Expand Up @@ -1017,7 +1017,7 @@ The breaking changes are as follows:
[style recommendations](https://www.juliaopt.org/JuMP.jl/dev/style/).

- We rely on broadcasting syntax to apply accessors to collections of
variables, e.g., `value.(x)` instead of `getvalue(x)` for collections. (Use
variables, for example, `value.(x)` instead of `getvalue(x)` for collections. (Use
`value(x)` when `x` is a scalar object.)

### Added
Expand All @@ -1030,15 +1030,15 @@ The breaking changes are as follows:
- The documentation has been completely rewritten using docstrings and
Documenter.

- Support for modeling mixed conic and quadratic models (e.g., conic models
- Support for modeling mixed conic and quadratic models (for example, conic models
with quadratic objectives and bi-linear matrix inequalities).

- Significantly improved support for modeling new types of constraints and for
extending JuMP's macros.

- Support for providing dual warm starts.

- Improved support for accessing solver-specific attributes (e.g., the
- Improved support for accessing solver-specific attributes (for example, the
irreducible inconsistent subsystem).

- Explicit control of whether symmetry-enforcing constraints are added to PSD
Expand Down Expand Up @@ -1070,11 +1070,11 @@ release (0.19.x or later):

- We do not yet have an implementation of solver-specific callbacks.

- The column generation syntax in `@variable` has been removed (i.e., the
- The column generation syntax in `@variable` has been removed (that is, the
`objective`, `coefficients`, and `inconstraints` keyword arguments). Support
for column generation will be re-introduced in a future release.

- The ability to solve the continuous relaxation (i.e. via
- The ability to solve the continuous relaxation (that is, via
`solve(model; relaxation = true)`) is not yet reimplemented ([issue](https://github.com/JuliaOpt/JuMP.jl/issues/1611)).

## Version 0.18.5 (December 1, 2018)
Expand Down Expand Up @@ -1154,11 +1154,11 @@ The following changes are primarily of interest to developers of JuMP extensions

* Julia 0.5.0 is the minimum required version for this release.
* Document support for BARON solver
* Enable info callbacks in more states than before, e.g. for recording solutions.
* Enable info callbacks in more states than before, for example, for recording solutions.
New `when` argument to `addinfocallback` ([#814](https://github.com/JuliaOpt/JuMP.jl/pull/814), thanks @yeesian)
* Improved support for anonymous variables. This includes new warnings for potentially confusing use of the traditional non-anonymous syntax:
* When multiple variables in a model are given the same name
* When non-symbols are used as names, e.g., `@variable(m, x[1][1:N])`
* When non-symbols are used as names, for example, `@variable(m, x[1][1:N])`
* Improvements in iterating over JuMP containers ([#836](https://github.com/JuliaOpt/JuMP.jl/pull/836), thanks @IssamT)
* Support for writing variable names in .lp file output (Thanks @leethargo)
* Support for querying duals to SDP problems (Thanks @blegat)
Expand All @@ -1183,7 +1183,7 @@ The following changes are primarily of interest to developers of JuMP extensions
## Version 0.14.0 (August 7, 2016)

* Compatibility with Julia 0.5 and ForwardDiff 0.2
* Support for "anonymous" variables, constraints, expressions, and parameters, e.g.,
* Support for "anonymous" variables, constraints, expressions, and parameters, for example,
`x = @variable(m, [1:N])` instead of `@variable(m, x[1:N])`
* Support for retrieving constraints from a model by name via `getconstraint`
* `@NLconstraint` now returns constraint references (as expected).
Expand Down Expand Up @@ -1213,7 +1213,7 @@ The following changes are primarily of interest to developers of JuMP extensions
* Specify variable lower/upper bounds in `@variable` using the `lowerbound` and `upperbound` keyword arguments.
* Change name printed for variable using the `basename` keyword argument to `@variable`.
* New `@variables` macro allows multi-line declaration of groups of variables.
* A number of solver methods previously available only through MathProgBase are now exposed directly in JuMP. The fix was [recorded](https://youtu.be/qF1lZPJ3a5A) live!
* A number of solver methods previously available only through MathProgBase are now exposed directly in JuMP. The fix was [recorded](https://youtu.be/qF1lZPJ3a5A) live.
* Compatibility fixes with Julia 0.5.
* The "end" indexing syntax is no longer supported within JuMPArrays which do not use 1-based indexing until upstream issues are resolved, see [here](https://github.com/JuliaOpt/JuMP.jl/issues/730).

Expand All @@ -1228,7 +1228,7 @@ The following changes are primarily of interest to developers of JuMP extensions
## Version 0.12.0 (February 27, 2016)

* The automatic differentiation functionality has been completely rewritten with a number of user-facing changes:
- `@defExpr` and `@defNLExpr` now take the model as the first argument. The previous one-argument version of `@defExpr` is deprecated; all expressions should be named. E.g., replace `@defExpr(2x+y)` with `@defExpr(jump_model, my_expr, 2x+y)`.
- `@defExpr` and `@defNLExpr` now take the model as the first argument. The previous one-argument version of `@defExpr` is deprecated; all expressions should be named. For example, replace `@defExpr(2x+y)` with `@defExpr(jump_model, my_expr, 2x+y)`.
- JuMP no longer uses Julia's variable binding rules for efficiently re-solving a sequence of nonlinear models. Instead, we have introduced nonlinear parameters. This is a breaking change, so we have added a warning message when we detect models that may depend on the old behavior.
- Support for user-defined functions integrated within nonlinear JuMP expressions.
* Replaced iteration over `AffExpr` with `Number`-like scalar iteration; previous iteration behavior is now available via `linearterms(::AffExpr)`.
Expand Down Expand Up @@ -1273,7 +1273,7 @@ The following changes are primarily of interest to developers of JuMP extensions

## Version 0.10.0 (August 31, 2015)

* Support (on Julia 0.4 and later) for conditions in indexing `@defVar` and `@addConstraint` constructs, e.g. `@defVar(m, x[i=1:5,j=1:5; i+j >= 3])`
* Support (on Julia 0.4 and later) for conditions in indexing `@defVar` and `@addConstraint` constructs, for example, `@defVar(m, x[i=1:5,j=1:5; i+j >= 3])`
* Support for vectorized operations on Variables and expressions. See the documentation for details.
* New `getVar()` method to access variables in a model by name
* Support for semidefinite programming.
Expand All @@ -1300,7 +1300,7 @@ The following changes are primarily of interest to developers of JuMP extensions

## Version 0.9.0 (April 18, 2015)

* Comparison operators for constructing constraints (e.g. `2x >= 1`) have been deprecated. Instead, construct the constraints explicitly in
* Comparison operators for constructing constraints (for example, `2x >= 1`) have been deprecated. Instead, construct the constraints explicitly in
the `@addConstraint` macro to add them to the model, or in the `@LinearConstraint` macro to create a stand-alone linear constraint instance.
* `getValue()` method implemented to compute the value of a nonlinear subexpression
* JuMP is now released under the Mozilla Public License version 2.0 (was previously LGPL). MPL is a copyleft license which is less restrictive than LGPL, especially for embedding JuMP within other applications.
Expand Down Expand Up @@ -1332,7 +1332,7 @@ The following changes are primarily of interest to developers of JuMP extensions
## Version 0.7.2 (January 9, 2015)

* Fix a bug in `sum(::JuMPDict)`
* Added the `setCategory` function to change a variables category (e.g. continuous or binary)
* Added the `setCategory` function to change a variables category (for example, continuous or binary)
after construction, and `getCategory` to retrieve the variable category.

## Version 0.7.1 (January 2, 2015)
Expand Down Expand Up @@ -1392,7 +1392,7 @@ The following changes are primarily of interest to developers of JuMP extensions
* New solver interfaces: ECOS, NLopt, and nonlinear support for MOSEK
* New option to control whether the lazy constraint callback is executed at each node in the B&B tree or just when feasible solutions are found
* Add support for semicontinuous and semi-integer variables for those solvers that support them.
* Add support for index dependencies (e.g. triangular indexing) in `@defVar`, `@addConstraint`, and `@defExpr` (e.g. `@defVar(m, x[i=1:10,j=i:10])`).
* Add support for index dependencies (for example, triangular indexing) in `@defVar`, `@addConstraint`, and `@defExpr` (for example, `@defVar(m, x[i=1:10,j=i:10])`).
- This required some changes to the internal structure of JuMP containers, which may break code that explicitly stored `JuMPDict` objects.

## Version 0.5.8 (September 24, 2014)
Expand Down Expand Up @@ -1492,7 +1492,7 @@ The following changes are primarily of interest to developers of JuMP extensions
## Version 0.1.2 (November 16, 2013)

* Bug fixes for printing, improved error messages.
* Allow `AffExpr` to be used in macros; e.g.,
* Allow `AffExpr` to be used in macros; for example,
`ex = y + z; @addConstraint(m, x + 2*ex <= 3)`

## Version 0.1.1 (October 23, 2013)
Expand Down
18 changes: 8 additions & 10 deletions docs/src/developers/contributing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# How to contribute to JuMP

Welcome! This document explains some ways you can contribute to JuMP.
Welcome, this document explains some ways you can contribute to JuMP.

## Code of Conduct

Expand All @@ -17,7 +17,7 @@ use the forum to discuss possible feature requests and bugs before raising a
GitHub issue (more on this below).

Aside from asking questions, the easiest way you can contribute to JuMP is to
help answer questions on the forum!
help answer questions on the forum.

## Join the developer chatroom

Expand All @@ -30,7 +30,7 @@ have in mind, and we can point you in the right direction.
Chances are, if you asked (or answered) a question on the community forum, then
it is a sign that the [documentation](https://jump.dev/JuMP.jl/dev/) could be
improved. Moreover, since it is your question, you are probably the best-placed
person to improve it!
person to improve it.

The docs are written in Markdown and are built using
[Documenter.jl](https://github.com/JuliaDocs/Documenter.jl).
Expand Down Expand Up @@ -68,7 +68,7 @@ before posting. You can also find a copy of that info

## Contribute code to JuMP

Finally, you can also contribute code to JuMP!
Finally, you can also contribute code to JuMP.

!!! warning
If you do not have experience with Git, GitHub, and Julia development, the
Expand All @@ -95,7 +95,7 @@ JuMP.

!!! tip
At this point, remember to be patient and polite; you may get a _lot_ of
comments on your issue! However, do not be afraid! Comments mean that people are
comments on your issue. However, do not be afraid. Comments mean that people are
willing to help you improve the code that you are contributing to JuMP.

**Step 2: fork JuMP**
Expand Down Expand Up @@ -211,7 +211,7 @@ and follow the instructions that pop up to open a pull request.
**Step 8: respond to comments**

At this point, remember to be patient and polite; you may get a _lot_ of
comments on your pull request! However, do not be afraid! A lot of comments
comments on your pull request. However, do not be afraid. A lot of comments
means that people are willing to help you improve the code that you are
contributing to JuMP.

Expand All @@ -222,7 +222,7 @@ automatically update.
**Step 9: cleaning up**

Once the PR is merged, clean-up your Git repository ready for the
next contribution!
next contribution.
```
$ cd ~/.julia/dev/JuMP

Expand All @@ -232,8 +232,6 @@ $ git pull
```

!!! note
If you have suggestions to improve this guide, please make a pull request!
If you have suggestions to improve this guide, please make a pull request.
It's particularly helpful if you do this after your first pull request
because you'll know all the parts that could be explained better.

Thanks for contributing to JuMP!
13 changes: 7 additions & 6 deletions docs/src/developers/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ still compatible and update the bound accordingly.
## Define a new set

To define a new set for JuMP, subtype `MOI.AbstractScalarSet` or
`MOI.AbstractVectorSet` and implement `Base.copy` for the set. That's it!
`MOI.AbstractVectorSet` and implement `Base.copy` for the set.

```jldoctest define_new_set
julia> struct NewMOIVectorSet <: MOI.AbstractVectorSet
Expand Down Expand Up @@ -148,7 +148,8 @@ julia> function JuMP.add_variable(

Now `AddTwice` can be passed to [`@variable`](@ref) similar to `Bin` or `Int`,
or through the `variable_type` keyword. However, now it adds two variables
instead of one!
instead of one.

```jldoctest new_variable
julia> model = Model();

Expand Down Expand Up @@ -249,7 +250,7 @@ Rewriting my_equal_to to ==
```

!!! tip
When parsing a constraint you can recurse into sub-constraint (e.g., the
When parsing a constraint you can recurse into sub-constraint (for example, the
`{expr}` in `z => {x <= 1}`) by calling [`parse_constraint`](@ref).

### Build
Expand All @@ -262,7 +263,7 @@ parse time, or it may mean implementing a method which handles additional
positional arguments.

[`build_constraint`](@ref) must return an [`AbstractConstraint`](@ref), which
can either be an [`AbstractConstraint`](@ref) already supported by JuMP, e.g., `ScalarConstraint` or `VectorConstraint`, or a custom
can either be an [`AbstractConstraint`](@ref) already supported by JuMP, for example, `ScalarConstraint` or `VectorConstraint`, or a custom
[`AbstractConstraint`](@ref) with a corresponding [`add_constraint`](@ref)
method (see [Add](@ref extension_add_constraint)).

Expand Down Expand Up @@ -293,8 +294,8 @@ my_con : x ≤ 2.0

!!! note
Only a single positional argument can be given to a particular constraint.
Extensions that seek to pass multiple arguments (e.g., `Foo` and `Bar`)
should combine them into one argument type (e.g., `FooBar`).
Extensions that seek to pass multiple arguments (for example, `Foo` and `Bar`)
should combine them into one argument type (for example, `FooBar`).

### [Add](@id extension_add_constraint)

Expand Down
Loading