Skip to content

Commit

Permalink
[doc] Use ™ on MOSEK and always capitalize it
Browse files Browse the repository at this point in the history
This changes Drake's published documentation and API to follow the
preferred trademark spelling. Various buried mentions in our private
source files are unchanged.

For the website, automatically hyperlink ™ to a trademarks page.
  • Loading branch information
jwnimmer-tri committed Feb 11, 2022
1 parent 0e18a34 commit 90be92b
Show file tree
Hide file tree
Showing 29 changed files with 131 additions and 79 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ if(WITH_GUROBI)
endif()
endif()

option(WITH_MOSEK "Build with support for MOSEK" OFF)
option(WITH_MOSEK "Build with support for MOSEK" OFF)

if(WITH_MOSEK)
list(APPEND BAZEL_CONFIGS --config=mosek)
Expand Down
4 changes: 2 additions & 2 deletions doc/_pages/apt.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Drake binary releases incorporate a pre-compiled version of
[Mathematical Program toolbox](https://drake.mit.edu/doxygen_cxx/group__solvers.html).
Thanks to Philip E. Gill and Elizabeth Wong for their kind support.

Drake's apt packages do not support the Mosek nor Gurobi solvers. To use
Mosek or Gurobi, you will need to [build Drake from source](/from_source.html).
Drake's apt packages do not support the MOSEK™ nor Gurobi solvers. To use
MOSEK™ or Gurobi, you will need to [build Drake from source](/from_source.html).

## Stable Releases

Expand Down
8 changes: 4 additions & 4 deletions doc/_pages/bazel.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ bazel build //tools/lint:buildifier
The Drake Bazel build currently supports the following proprietary solvers:

* Gurobi 9.0.2
* MOSEK 9.2
* MOSEK 9.2
* SNOPT 7.4

## Gurobi 9.0.2
Expand Down Expand Up @@ -203,17 +203,17 @@ See [https://docs.bazel.build/versions/master/user-manual.html#bazelrc](https://

## MOSEK

The Drake Bazel build system downloads MOSEK 9.2.33 automatically. No manual
The Drake Bazel build system downloads MOSEK 9.2.33 automatically. No manual
installation is required. Set the location of your license file as follows:

```export MOSEKLM_LICENSE_FILE=/path/to/mosek.lic```

To confirm that your setup was successful, run the tests that require MOSEK:
To confirm that your setup was successful, run the tests that require MOSEK:

```bazel test --config mosek --test_tag_filters=mosek //...```

The default value of ``--test_tag_filters`` in Drake's ``bazel.rc`` excludes
these tests. If you will be developing with MOSEK regularly, you may wish
these tests. If you will be developing with MOSEK regularly, you may wish
to specify a more convenient ``--test_tag_filters`` in a local ``.bazelrc``.
See [https://docs.bazel.build/versions/master/user-manual.html#bazelrc](https://docs.bazel.build/versions/master/user-manual.html#bazelrc).

Expand Down
4 changes: 2 additions & 2 deletions doc/_pages/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Drake binary releases incorporate a pre-compiled version of
[Mathematical Program toolbox](https://drake.mit.edu/doxygen_cxx/group__solvers.html).
Thanks to Philip E. Gill and Elizabeth Wong for their kind support.

Drake's docker images do not support the Mosek nor Gurobi solvers. To use
Mosek or Gurobi, you will need to [build Drake from source](/from_source.html).
Drake's docker images do not support the MOSEK™ nor Gurobi solvers. To use
MOSEK™ or Gurobi, you will need to [build Drake from source](/from_source.html).

## Stable Releases

Expand Down
4 changes: 2 additions & 2 deletions doc/_pages/from_binary.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Drake binary releases incorporate a pre-compiled version of
[Mathematical Program toolbox](https://drake.mit.edu/doxygen_cxx/group__solvers.html).
Thanks to Philip E. Gill and Elizabeth Wong for their kind support.

Drake's binary releases do not support the Mosek nor Gurobi solvers. To use
Mosek or Gurobi, you will need to [build Drake from source](/from_source.html).
Drake's binary releases do not support the MOSEK™ nor Gurobi solvers. To use
MOSEK™ or Gurobi, you will need to [build Drake from source](/from_source.html).

## Stable Releases

Expand Down
4 changes: 2 additions & 2 deletions doc/_pages/from_source.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ make -j
Please note the additional CMake options which affect the Python bindings:

* ``-DWITH_GUROBI={ON, [OFF]}`` - Build with Gurobi enabled.
* ``-DWITH_MOSEK={ON, [OFF]}`` - Build with MOSEK enabled.
* ``-DWITH_MOSEK={ON, [OFF]}`` - Build with MOSEK enabled.
* ``-DWITH_SNOPT={ON, [OFF]}`` - Build with SNOPT enabled.

``{...}`` means a list of options, and the option surrounded by ``[...]`` is
the default option. An example of building ``pydrake`` with both Gurobi and
MOSEK, without building tests:
MOSEK, without building tests:

```bash
cmake -DWITH_GUROBI=ON -DWITH_MOSEK=ON ../drake
Expand Down
4 changes: 2 additions & 2 deletions doc/_pages/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ All other packages support both C++ and/or Python.
Alternatively, you can skip the pre-compiled binaries and
[build Drake from source](/from_source.html).

Drake's binary releases do not support the Mosek nor Gurobi solvers.
To use Mosek or Gurobi, you must build Drake from source.
Drake's binary releases do not support the MOSEK™ nor Gurobi solvers.
To use MOSEK™ or Gurobi, you must build Drake from source.

We're considering adding macOS support for Homebrew, i.e., ``brew install
drake``. Please upvote or comment on
Expand Down
4 changes: 2 additions & 2 deletions doc/_pages/pip.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Drake binary releases incorporate a pre-compiled version of
[Mathematical Program toolbox](https://drake.mit.edu/doxygen_cxx/group__solvers.html).
Thanks to Philip E. Gill and Elizabeth Wong for their kind support.

Drake's pip packages do not support the Mosek nor Gurobi solvers. To use
Mosek or Gurobi, you will need to [build Drake from source](/from_source.html).
Drake's pip packages do not support the MOSEK™ nor Gurobi solvers. To use
MOSEK™ or Gurobi, you will need to [build Drake from source](/from_source.html).

## Stable Releases

Expand Down
9 changes: 9 additions & 0 deletions doc/_pages/tm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Trademarks
---

All trademarks, logos and brand names are the property of their respective
owners.

MOSEK™ is a trademark of [MOSEK](https://www.mosek.com/) and is mentioned in
Drake's documentation under a license from [MOSEK](https://www.mosek.com/).
2 changes: 1 addition & 1 deletion doc/_release-notes/v0.13.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Newly bound
## Build system and dependencies

* Provide nightly binary docker images ([#10554][_#10554], [#12364][_#12364], [#12367][_#12367], [#12446][_#12446])
* Fix missing pthread linkopts for MOSEK ([#12337][_#12337])
* Fix missing pthread linkopts for MOSEK ([#12337][_#12337])
* Fix variable name in FindTinyXML2 ([#12339][_#12339])
* Fix ByteSizeLong for Protobuf 3.11.0 or above ([#12425][_#12425])
* Fix linters' find_all_sources --all commands ([#12369][_#12369], [#12385][_#12385], [#12424][_#12424])
Expand Down
4 changes: 2 additions & 2 deletions doc/_release-notes/v0.25.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ New features
Fixes

* Throw an error when getting dual solution for a QCP in Gurobi (`[#14285][_#14285])
* Only retrieve Mosek dual solution when there are no integer variables ([#14338][_#14338]`)
* Retrieve linear constraint dual from Mosek result ([#14348][_#14348])
* Only retrieve MOSEK™ dual solution when there are no integer variables ([#14338][_#14338]`)
* Retrieve linear constraint dual from MOSEK™ result ([#14348][_#14348])
* Ensure IPOPT uses MUMPS as its linear solver ([#14446][_#14446], [#14288][_#14288])

## Multibody Dynamics
Expand Down
4 changes: 2 additions & 2 deletions doc/_release-notes/v0.26.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Fixes

New features

* Retrieve dual solution for conic constraint in Mosek ([#14383][_#14383])
* Retrieve dual solution for conic constraint in MOSEK™ ([#14383][_#14383])
* Allow for incomplete symbolic derivatives ([#14514][_#14514])

Fixes
Expand Down Expand Up @@ -87,7 +87,7 @@ Newly bound
* Downgrade spdlog to release 5.1.0 ([#14427][_#14427])
* Upgrade fcl to latest commit ([#14497][_#14497])
* Upgrade ghc_filesystem to latest release 1.4.0 ([#14504][_#14504])
* Upgrade mosek to latest release 9.2 ([#14484][_#14484])
* Upgrade MOSEK™ to latest release 9.2 ([#14484][_#14484])
* Upgrade optitrack_driver to latest commit ([#14451][_#14451])
* Allow sphinx-build to be missing during bazel fetch ([#14528][_#14528])
* Add dependency on TRI common_robotics_utilities; for now this is only used by test code, but in a future release will be used by a forthcoming new drake/planning/... library ([#14437][_#14437], [#14530][_#14530])
Expand Down
2 changes: 1 addition & 1 deletion doc/_release-notes/v0.39.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ New features
Fixes

* Improve performance while adding variables ([#16472][_#16472])
* Mosek's debug printing includes the solution summary ([#16528][_#16528])
* MOSEK™ debug printing includes the solution summary ([#16528][_#16528])

## Multibody Dynamics and Geometry

Expand Down
29 changes: 29 additions & 0 deletions doc/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,35 @@ def check_call(args, *, cwd=None):
proc.check_returncode()


def perl_cleanup_html_output(*, out_dir, extra_perl_statements=None):
"""Runs a cleanup pass over all HTML output files, using a set of built-in
fixups. Calling code may pass its own extra statements, as well.
"""
# Collect the list of all HTML output files.
html_files = []
for dirpath, _, filenames in os.walk(out_dir):
for filename in filenames:
if filename.endswith(".html"):
html_files.append(os.path.relpath(
os.path.join(dirpath, filename), out_dir))

# Figure out what to do.
default_perl_statements = [
# Add trademark hyperlink.
r's#™#<a href="/tm.html">™</a>#g;',
]
perl_statements = default_perl_statements + (extra_perl_statements or [])
for x in perl_statements:
assert x.endswith(';'), x

# Do it.
while html_files:
# Work in batches of 100, so we don't overflow the argv limit.
first, html_files = html_files[:100], html_files[100:]
check_call(["perl", "-pi", "-e", "".join(perl_statements)] + first,
cwd=out_dir)


def _call_build(*, build, out_dir):
"""Calls build() into out_dir, while also supplying a temp_dir."""
with tempfile.TemporaryDirectory(
Expand Down
25 changes: 11 additions & 14 deletions doc/doxygen_cxx/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@

from bazel_tools.tools.python.runfiles import runfiles

from drake.doc.defs import check_call, main, symlink_input, verbose
from drake.doc.defs import (
check_call,
main,
perl_cleanup_html_output,
symlink_input,
verbose,
)


def _symlink_headers(*, drake_workspace, temp_dir, modules):
Expand Down Expand Up @@ -246,15 +252,8 @@ def _build(*, out_dir, temp_dir, modules, quick):
]
_postprocess_doxygen_log(lines, check_for_errors)

# Collect the list of all HTML output files.
html_files = []
for dirpath, _, filenames in os.walk(out_dir):
for filename in filenames:
if filename.endswith(".html"):
html_files.append(relpath(join(dirpath, filename), out_dir))

# Fix the formatting of deprecation text (see drake#15619 for an example).
perl_statements = [
extra_perl_statements = [
# Remove quotes around the removal date.
r's#(removed from Drake on or after) "(....-..-..)" *\.#\1 \2.#;',
# Remove all quotes within the explanation text, i.e., the initial and
Expand All @@ -267,11 +266,9 @@ def _build(*, out_dir, temp_dir, modules, quick):
# <dd><a class="anchor" id="_deprecated000013"></a>"Use RotationMatrix::MakeFromOneVector()." <br /> # noqa
r'while (s#(?<=_deprecated\d{6}")([^"]*)"(.*?<br)#\1\2#) {};',
]
while html_files:
# Work in batches of 100, so we don't overflow the argv limit.
first, html_files = html_files[:100], html_files[100:]
check_call(["perl", "-pi", "-e", "".join(perl_statements)] + first,
cwd=out_dir)
perl_cleanup_html_output(
out_dir=out_dir,
extra_perl_statements=extra_perl_statements)

# The nominal pages to offer for preview.
return ["", "classes.html", "modules.html"]
Expand Down
10 changes: 9 additions & 1 deletion doc/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
import os
import tempfile

from drake.doc.defs import check_call, main, symlink_input
from drake.doc.defs import (
check_call,
main,
perl_cleanup_html_output,
symlink_input,
)


def _build(*, out_dir, temp_dir):
Expand All @@ -26,6 +31,9 @@ def _build(*, out_dir, temp_dir):
"--destination", out_dir,
])

# Tidy up.
perl_cleanup_html_output(out_dir=out_dir)

# The filename to suggest as the starting point for preview; in this case,
# it's an empty filename (i.e., the index page).
return [""]
Expand Down
11 changes: 10 additions & 1 deletion doc/pydrake/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
from os.path import join
import sys

from drake.doc.defs import check_call, main, symlink_input, verbose
from drake.doc.defs import (
check_call,
main,
perl_cleanup_html_output,
symlink_input,
verbose,
)

import pydrake.all
# TODO(eric.cousineau): Make an optional `.all` module.
Expand Down Expand Up @@ -167,6 +173,9 @@ def _build(*, out_dir, temp_dir, modules):
out_dir,
])

# Tidy up.
perl_cleanup_html_output(out_dir=out_dir)

# The filename to suggest as the starting point for preview; in this case,
# it's an empty filename (i.e., the index page).
return [""]
Expand Down
2 changes: 1 addition & 1 deletion solvers/constraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ class ExpressionConstraint : public Constraint {
* generic nonlinear optimization. It is possible that the nonlinear solver
* can accidentally set z₁ = 0, where the constraint is not well defined.
* Instead, the user should consider to solve the program through conic solvers
* that can exploit exponential cone, such as Mosek and SCS.
* that can exploit exponential cone, such as MOSEK™ and SCS.
*
* @ingroup solver_evaluators
*/
Expand Down
2 changes: 1 addition & 1 deletion solvers/mathematical_program.h
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ class MathematicalProgram {
* Adds an L2 norm cost min |Ax+b|₂ as a linear cost min s
* on the slack variable s, together with a Lorentz cone constraint
* s ≥ |Ax+b|₂
* Many conic optimization solvers (Gurobi, Mosek, SCS, etc) natively prefers
* Many conic optimization solvers (Gurobi, MOSEK™, SCS, etc) natively prefers
* this form of linear cost + conic constraints. So if you are going to use
* one of these conic solvers, then add the L2 norm cost using this function
* instead of AddL2NormCost().
Expand Down
4 changes: 2 additions & 2 deletions solvers/mathematical_program_doxygen.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
* <td></td>
* </tr>
* <tr><td><a href="https://www.mosek.com/products/mosek">
* Mosek</a> †</td>
* MOSEK™</a> †</td>
* <td align="center">♦</td>
* <td align="center">♦</td>
* <td align="center">♦</td>
Expand Down Expand Up @@ -182,7 +182,7 @@
* <td></td>
* </tr>
* <tr><td><a href="https://www.mosek.com/products/mosek">
* Mosek</a> †</td>
* MOSEK™</a> †</td>
* <td align="center">♦</td>
* <td align="center">♦</td>
* <td align="center">♦</td>
Expand Down
4 changes: 2 additions & 2 deletions solvers/mathematical_program_result.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ class MathematicalProgramResult final {
* 2. For nonlinear solvers like IPOPT, the dual solution for Lorentz cone
* constraint (with EvalType::kConvex) is the shadow price for
* z₀ - sqrt(z₁² + ... +zₙ²) ≥ 0, where z = Ax+b.
* 3. For other convex conic solver such as SCS, Mosek, CSDP, etc, the dual
* 3. For other convex conic solver such as SCS, MOSEK™, CSDP, etc, the dual
* solution to the (rotated) Lorentz cone constraint doesn't have the
* "shadow price" interpretation, but should lie in the dual cone, and
* satisfy the KKT condition. For more information, refer to
Expand All @@ -310,7 +310,7 @@ class MathematicalProgramResult final {
* The interpretation for the dual variable to conic constraint x ∈ K can be
* different. Here K is a convex cone, including exponential cone, power
* cone, PSD cone, etc. When the problem is solved by a convex solver (like
* SCS, Mosek, CSDP, etc), often it has a dual variable z ∈ K*, where K* is
* SCS, MOSEK™, CSDP, etc), often it has a dual variable z ∈ K*, where K* is
* the dual cone. Here the dual variable DOESN'T have the interpretation of
* "shadow price", but should satisfy the KKT condition, while the dual
* variable stays inside the dual cone.
Expand Down
Loading

0 comments on commit 90be92b

Please sign in to comment.