Skip to content

Commit b74c43c

Browse files
committed
set default_role to py:obj to allow use of single backticks
1 parent bacae52 commit b74c43c

File tree

6 files changed

+52
-49
lines changed

6 files changed

+52
-49
lines changed

doc/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@
118118
#
119119
html_theme = 'sphinx_rtd_theme'
120120

121+
# Set the default role to render items in backticks as code
122+
default_role = 'py:obj'
123+
121124
# Theme options are theme-specific and customize the look and feel of a theme
122125
# further. For a list of options available for each theme, see the
123126
# documentation.

doc/intro.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ some things to keep in mind:
104104
* Functions that return multiple values use either objects (with
105105
elements for each return value) or tuples. The number of elements
106106
in a tuple is fixed and so functions that return variable numbers of
107-
return values will have a parameter of the form ``return_<val>``
107+
return values will have a parameter of the form `return_<val>`
108108
that is used to return additional data.
109109
* You cannot use braces for collections; use tuples instead.
110110
* Time series data have time as the final index (see

doc/iosys.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -252,14 +252,14 @@ In this command, the states and the inputs are broadcast to the size of the
252252
state and input vectors, respectively.
253253

254254
If we want to linearize the closed loop system around a process state
255-
``x0`` (with two elements) and an estimator state ``0`` (for both states),
255+
`x0` (with two elements) and an estimator state `0` (for both states),
256256
we can use the list processing feature::
257257

258258
H = clsys.linearize([x0, 0], 0)
259259

260260
Note that this also utilizes the zero-padding functionality, since the
261-
second argument in the list ``[x0, 0]`` is a scalar and so the vector
262-
``[x0, 0]`` only has three elements instead of the required four.
261+
second argument in the list `[x0, 0]` is a scalar and so the vector
262+
`[x0, 0]` only has three elements instead of the required four.
263263

264264
To run an input/output simulation with a sinusoidal signal for the first
265265
input, a constant for the second input, and no external disturbance, we can
@@ -285,8 +285,8 @@ use the command
285285
286286
sumblk = ct.summing_junction(3)
287287
288-
By default, the name of the inputs will be of the form ``u[i]`` and the output
289-
will be ``y``. This can be changed by giving an explicit list of names::
288+
By default, the name of the inputs will be of the form `u[i]` and the output
289+
will be `y`. This can be changed by giving an explicit list of names::
290290

291291
sumblk = ct.summing_junction(inputs=['a', 'b', 'c'], output='d')
292292

@@ -306,16 +306,16 @@ the command
306306
307307
sumblk = ct.summing_junction(inputs=['r', '-y'], output='e', dimension=2)
308308
309-
will produce an input/output block that implements ``e[0] = r[0] - y[0]`` and
310-
``e[1] = r[1] - y[1]``.
309+
will produce an input/output block that implements `e[0] = r[0] - y[0]` and
310+
`e[1] = r[1] - y[1]`.
311311

312312
Automatic connections using signal names
313313
----------------------------------------
314314

315315
The :func:`~control.interconnect` function allows the interconnection of
316-
multiple systems by using signal names of the form ``sys.signal``. In many
316+
multiple systems by using signal names of the form `sys.signal`. In many
317317
situations, it can be cumbersome to explicitly connect all of the appropriate
318-
inputs and outputs. As an alternative, if the ``connections`` keyword is
318+
inputs and outputs. As an alternative, if the `connections` keyword is
319319
omitted, the :func:`~control.interconnect` function will connect all signals
320320
of the same name to each other. This can allow for simplified methods of
321321
interconnecting systems, especially when combined with the
@@ -331,7 +331,7 @@ If a signal name appears in multiple outputs then that signal will be summed
331331
when it is interconnected. Similarly, if a signal name appears in multiple
332332
inputs then all systems using that signal name will receive the same input.
333333
The :func:`~control.interconnect` function will generate an error if a signal
334-
listed in ``inplist`` or ``outlist`` (corresponding to the inputs and outputs
334+
listed in `inplist` or `outlist` (corresponding to the inputs and outputs
335335
of the interconnected system) is not found, but inputs and outputs of
336336
individual systems that are not connected to other systems are left
337337
unconnected (so be careful!).

doc/linear.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ argument::
109109
mag, phase, omega = response(squeeze=False)
110110

111111
Frequency response objects are also available as named properties of the
112-
``response`` object: ``response.magnitude``, ``response.phase``, and
113-
``response.response`` (for the complex response). For MIMO systems, these
112+
`response` object: `response.magnitude`, `response.phase`, and
113+
`response.response` (for the complex response). For MIMO systems, these
114114
elements of the frequency response can be accessed using the names of the
115115
inputs and outputs::
116116

@@ -119,8 +119,8 @@ inputs and outputs::
119119
where the signal names are based on the system that generated the frequency
120120
response.
121121

122-
Note: The ``fresp`` data member is stored as a NumPy array and cannot be
123-
accessed with signal names. Use ``response.response`` to access the
122+
Note: The `fresp` data member is stored as a NumPy array and cannot be
123+
accessed with signal names. Use `response.response` to access the
124124
complex frequency response using signal names.
125125

126126
Multi-input, multi-output (MIMO) systems
@@ -137,8 +137,8 @@ names::
137137

138138
Signal names for an indexed subsystem are preserved from the original
139139
system and the subsystem name is set according to the values of
140-
``config.defaults['iosys.indexed_system_name_prefix']`` and
141-
``config.defaults['iosys.indexed_system_name_suffix']``. The default
140+
`config.defaults['iosys.indexed_system_name_prefix']` and
141+
`config.defaults['iosys.indexed_system_name_suffix']`. The default
142142
subsystem name is the original system name with '$indexed' appended.
143143

144144
.. include:: statesp.rst

doc/optimal.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ Module classes and functions
468468
----------------------------
469469

470470
The following classes and functions are defined in the
471-
``optimal`` module:
471+
`optimal` module:
472472

473473
.. autosummary::
474474
:template: custom-class-template.rst

doc/response.rst

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,13 @@ array of frequencies as a second argument (after the list of systems)::
275275
.. image:: figures/freqplot-siso_bode-omega.png
276276

277277
Alternatively, frequency ranges can be specified by passing a list of the
278-
form ``[wmin, wmax]``, where ``wmin`` and ``wmax`` are the minimum and
278+
form `[wmin, wmax]`, where `wmin` and `wmax` are the minimum and
279279
maximum frequencies in the (log-spaced) frequency range::
280280

281281
response = ct.frequency_response([sys1, sys2], [1e-2, 1e2])
282282

283283
The number of (log-spaced) points in the frequency can be specified using
284-
the ``omega_num`` keyword parameter.
284+
the `omega_num` keyword parameter.
285285

286286
Frequency response data can also be accessed directly and plotted manually::
287287

@@ -290,9 +290,9 @@ Frequency response data can also be accessed directly and plotted manually::
290290
plt.loglog(fresp.omega, fresp.magnitude['y[1]', 'u[0]'])
291291

292292
Access to frequency response data is available via the attributes
293-
``omega``, ``magnitude``,` `phase``, and ``response``, where ``response``
293+
`omega`, `magnitude`,` `phase`, and `response`, where `response`
294294
represents the complex value of the frequency response at each frequency.
295-
The ``magnitude``, ``phase``, and ``response`` arrays can be indexed using
295+
The `magnitude`, `phase`, and `response` arrays can be indexed using
296296
either input/output indices or signal names, with the first index
297297
corresponding to the output signal and the second input corresponding to
298298
the input signal.
@@ -464,20 +464,20 @@ various ways. The following general rules apply:
464464
sequentially, the :func:`matplotlib.pyplot.figure` command should be used
465465
to explicitly create a new figure.
466466

467-
* The ``ax`` keyword argument can be used to direct the plotting function
468-
to use a specific axes or array of axes. The value of the ``ax`` keyword
467+
* The `ax` keyword argument can be used to direct the plotting function
468+
to use a specific axes or array of axes. The value of the `ax` keyword
469469
must have the proper number of axes for the plot (so a plot generating a
470-
2x2 array of subplots should be given a 2x2 array of axes for the ``ax``
470+
2x2 array of subplots should be given a 2x2 array of axes for the `ax`
471471
keyword).
472472

473-
* The ``color``, ``linestyle``, ``linewidth``, and other matplotlib line
473+
* The `color`, `linestyle`, `linewidth`, and other matplotlib line
474474
property arguments can be used to override the default line properties.
475475
If these arguments are absent, the default matplotlib line properties are
476476
used and the color cycles through the default matplotlib color cycle.
477477

478478
The :func:`~control.bode_plot`, :func:`~control.time_response_plot`,
479479
and selected other commands can also accept a matplotlib format
480-
string (e.g., ``'r--'``). The format string must appear as a positional
480+
string (e.g., `'r--'`). The format string must appear as a positional
481481
argument right after the required data argument.
482482

483483
Note that line property arguments are the same for all lines generated as
@@ -486,9 +486,9 @@ various ways. The following general rules apply:
486486
often easiest to call multiple plot commands in sequence, with each
487487
command setting the line properties for that system/trace.
488488

489-
* The ``label`` keyword argument can be used to override the line labels
489+
* The `label` keyword argument can be used to override the line labels
490490
that are used in generating the title and legend. If more than one line
491-
is being plotted in a given call to a plot command, the ``label``
491+
is being plotted in a given call to a plot command, the `label`
492492
argument value should be a list of labels, one for each line, in the
493493
order they will appear in the legend.
494494

@@ -502,33 +502,33 @@ various ways. The following general rules apply:
502502
For non-input/output plots (e.g., Nyquist plots, pole/zero plots, root
503503
locus plots), the default labels are the system name.
504504

505-
If ``label`` is set to ``False``, individual lines are still given
505+
If `label` is set to `False`, individual lines are still given
506506
labels, but no legend is generated in the plot. (This can also be
507-
accomplished by setting ``legend_map`` to ``False``).
507+
accomplished by setting `legend_map` to `False`).
508508

509-
Note: the ``label`` keyword argument is not implemented for describing
509+
Note: the `label` keyword argument is not implemented for describing
510510
function plots or phase plane plots, since these plots are primarily
511-
intended to be for a single system. Standard ``matplotlib`` commands can
511+
intended to be for a single system. Standard `matplotlib` commands can
512512
be used to customize these plots for displaying information for multiple
513513
systems.
514514

515-
* The ``legend_loc``, ``legend_map`` and ``show_legend`` keyword arguments
515+
* The `legend_loc`, `legend_map` and `show_legend` keyword arguments
516516
can be used to customize the locations for legends. By default, a
517517
minimal number of legends are used such that lines can be uniquely
518518
identified and no legend is generated if there is only one line in the
519-
plot. Setting ``show_legend`` to ``False`` will suppress the legend and
520-
setting it to ``True`` will force the legend to be displayed even if
519+
plot. Setting `show_legend` to `False` will suppress the legend and
520+
setting it to `True` will force the legend to be displayed even if
521521
there is only a single line in each axes. In addition, if the value of
522-
the ``legend_loc`` keyword argument is set to a string or integer, it
522+
the `legend_loc` keyword argument is set to a string or integer, it
523523
will set the position of the legend as described in the
524-
:func:`matplotlib.legend` documentation. Finally, ``legend_map`` can be
524+
:func:`matplotlib.legend` documentation. Finally, `legend_map` can be
525525
set to an array that matches the shape of the subplots, with each item
526526
being a string indicating the location of the legend for that axes (or
527-
``None`` for no legend).
527+
`None` for no legend).
528528

529-
* The ``rcParams`` keyword argument can be used to override the default
529+
* The `rcParams` keyword argument can be used to override the default
530530
matplotlib style parameters used when creating a plot. The default
531-
parameters for all control plots are given by the ``ct.rcParams``
531+
parameters for all control plots are given by the `ct.rcParams`
532532
dictionary and have the following values:
533533

534534
.. list-table::
@@ -551,8 +551,8 @@ various ways. The following general rules apply:
551551
- 'small'
552552

553553
Only those values that should be changed from the default need to be
554-
specified in the ``rcParams`` keyword argument. To override the defaults
555-
for all control plots, update the ``ct.rcParams`` dictionary entries.
554+
specified in the `rcParams` keyword argument. To override the defaults
555+
for all control plots, update the `ct.rcParams` dictionary entries.
556556

557557
The default values for style parameters for control plots can be restored
558558
using :func:`~control.reset_rcParams`.
@@ -570,15 +570,15 @@ various ways. The following general rules apply:
570570
and phase portions of the plot, and `share_frequency` can be used instead
571571
of `sharex`.
572572

573-
* The ``title`` keyword can be used to override the automatic creation of
573+
* The `title` keyword can be used to override the automatic creation of
574574
the plot title. The default title is a string of the form "<Type> plot
575575
for <syslist>" where <syslist> is a list of the sys names contained in
576576
the plot (which can be updated if the plotting is called multiple times).
577-
Use ``title=False`` to suppress the title completely. The title can also
577+
Use `title=False` to suppress the title completely. The title can also
578578
be updated using the :func:`~control.ControlPlot.set_plot_title` method
579579
for the returned control plot object.
580580

581-
The plot title is only generated if ``ax`` is ``None``.
581+
The plot title is only generated if `ax` is `None`.
582582

583583
The following code illustrates the use of some of these customization
584584
features::
@@ -632,8 +632,8 @@ example::
632632

633633
.. image:: figures/ctrlplot-pole_zero_subplots.png
634634

635-
Alternatively, turning off the omega-damping grid (using ``grid=False`` or
636-
``grid='empty'``) allows use of Matplotlib layout commands.
635+
Alternatively, turning off the omega-damping grid (using `grid=False` or
636+
`grid='empty'`) allows use of Matplotlib layout commands.
637637

638638

639639
Response and plotting functions
@@ -645,7 +645,7 @@ Response functions
645645
Response functions take a system or list of systems and return a response
646646
object that can be used to retrieve information about the system (e.g., the
647647
number of encirclements for a Nyquist plot) as well as plotting (via the
648-
``plot`` method).
648+
`plot` method).
649649

650650
.. autosummary::
651651

0 commit comments

Comments
 (0)