Skip to content

Commit

Permalink
docs: Fix basic rst formatting errors (#2958)
Browse files Browse the repository at this point in the history
Fix the following warnings:
WARNING: Malformed table. (3 instances)
WARNING: Title underline too short. (13 instances)
WARNING: Inline strong start-string without end-string. (31 instances)
WARNING: Inline literal start-string without end-string. (1 instance)
WARNING: Inline emphasis start-string without end-string. (2 instances)
WARNING: Unknown target name (3 instances)
WARNING: Inline interpreted text or phrase reference start-string without end-string. (31 instances)
WARNING: Inline substitution_reference start-string without end-string. (1 instance)

The above removes 61/81 instances of <span class="problematic"> in the generated html.
  • Loading branch information
jvesely authored May 1, 2024
2 parents 924530a + f91fe9a commit 022c5b7
Show file tree
Hide file tree
Showing 30 changed files with 94 additions and 96 deletions.
2 changes: 1 addition & 1 deletion docs/source/Cohen_HustonModel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ are turned on again and the system is run either for a certain amount of trials,
stimulus is turned on.

PLEASE NOTE:
-----------
------------
Note that this implementation is slightly different than what was originally reported. The integration rate was set to
0.1 instead of 0.01. Noise was turned of to better understand the core processes, and not having to deal with several
runs, averaging these runs and plotting standard errors for these averages (which depend on the noise and amount of
Expand Down
2 changes: 1 addition & 1 deletion docs/source/ConventionsAndDefinitions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ and Compositions (combinations of Components that implement a model).
.. _Definitions_Components:

`Components <Component>`
~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~

Components are objects that perform a specific function. Every Component has a:

Expand Down
2 changes: 1 addition & 1 deletion docs/source/MontagueModel.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Dopamine and Temporal Differences Learning (Montague, Dayan & Sejnowski, 1996)
==================================================================
==============================================================================
`"A framework for mesencephalic dopamine systems based on predictive Hebbian learning." <http://www.jneurosci.org/content/jneuro/16/5/1936.full.pdf>`_

Overview
Expand Down
16 changes: 8 additions & 8 deletions docs/source/NieuwenhuisModel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,18 @@ associated `ObjectiveMechanism`, as shown in the figure below:
Behavioral Network Subsystem
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**INPUT LAYER**: a `TransferMechanism` with **size**=3 (one element for the input to the T1, T2 and distractor units
of the *DECISION LAYER*, respectively), and assigned a `Linear` function with **slope**=1.0 and **intercept**=0.0.
**INPUT LAYER**: a `TransferMechanism` with **size**\ =3 (one element for the input to the T1, T2 and distractor units
of the *DECISION LAYER*, respectively), and assigned a `Linear` function with **slope**\ =1.0 and **intercept**\ =0.0.

**DECISION LAYER**: an `LCAMechanism` Mechanism of **size**=3 (one element each for the T1, T2 and distractor units),
**DECISION LAYER**: an `LCAMechanism` Mechanism of **size**\ =3 (one element each for the T1, T2 and distractor units),
and assigned a `Logistic` Function with a slope=1.0 and intercept=0.0. Each element has a self-excitatory connection
with a weight specified by **self_excitation**=2.5, a **leak**=-1.0, and every element is connected to every other
element by mutually inhibitory connections with a weight specified by **competition**=1.0. An ordinary differential
with a weight specified by **self_excitation**\ =2.5, a **leak**\ =-1.0, and every element is connected to every other
element by mutually inhibitory connections with a weight specified by **competition** =1.0. An ordinary differential
equation describes the change in state over time, implemented in the LCAMechanism mechanism by setting
**integrator_mode**=`True` and **time_step_size**=0.02.
**integrator_mode** = `True` and **time_step_size**\ =0.02.

**RESPONSE LAYER**: an `LCAMechanism` Mechanism of **size**=2, with one element each for the response to T1 and T2,
respectively, **self_excitation**=2.0, **leak**=-1.0, and no mutually inhibitory weights (**competition**=0).
**RESPONSE LAYER**: an `LCAMechanism` Mechanism of **size**\ =2, with one element each for the response to T1 and T2,
respectively, **self_excitation**\ =2.0, **leak**\ =-1.0, and no mutually inhibitory weights (**competition**\ =0).

**PROJECTIONS**: The weights of the behavioral network are implemented as `MappingProjections <MappingProjection>`.
The `matrix <MappingProjection.matrix>` parameter for the one from the *INPUT_LAYER* to the *DECISION_LAYER* uses a
Expand Down
2 changes: 1 addition & 1 deletion docs/source/PCTC_model.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Proactive Control & Task Control: A Stroop Model (Kalanthroff et al., 2018)
================================================================
===========================================================================
`"Task Conflict and Proactive Control: A Computational Theory of the Stroop Task" <https://www.ncbi.nlm.nih.gov/m/pubmed/25257710/>`_

Overview
Expand Down
2 changes: 1 addition & 1 deletion psyneulink/core/components/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
.. note::
The size attribute serves a role similar to
`shape <https://numpy.org/doc/stable/reference/generated/numpy.shape.html> in Numpy`_, with the difference that
`shape in Numpy <https://numpy.org/doc/stable/reference/generated/numpy.shape.html>`_, with the difference that
size permits the specification of `ragged arrays <https://en.wikipedia.org/wiki/Jagged_array>`_ -- that is, ones
that have elements of varying lengths, such as [[1,2],[3,4,5]].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,12 @@ class OptimizationFunction(Function_Base):
relevant argument(s) as `NotImplemented`.
.. technical_note::
- Constructors of subclasses should include **kwargs in their constructor method, to accommodate arguments
- Constructors of subclasses should include ``**kwargs`` in their constructor method, to accommodate arguments
required by some subclasses but not others (e.g., search_space needed by `GridSearch` but not
`GradientOptimization`) so that subclasses can be used interchangeably by OptimizationControlMechanism.
- Subclasses with attributes that depend on one of the OptimizationFunction's parameters should implement the
`reset <OptimizationFunction.reset>` method, that calls super().reset(*args) and then
`reset <OptimizationFunction.reset>` method, that calls ``super().reset(*args)`` and then
reassigns the values of the dependent attributes accordingly. If an argument is not needed for the subclass,
`NotImplemented` should be passed as the argument's value in the call to super (i.e.,
the OptimizationFunction's
Expand Down Expand Up @@ -839,7 +839,7 @@ def _is_static(it:SampleIterator):
return outcomes, num_evals

def reset_grid(self):
"""Reset iterators in `search_space <GridSearch.search_space>"""
"""Reset iterators in `search_space <GridSearch.search_space>`"""
for s in self.search_space:
s.reset()
self.grid = itertools.product(*[s for s in self.search_space])
Expand Down Expand Up @@ -907,7 +907,7 @@ class GradientOptimization(OptimizationFunction):
Sample variable by following gradient with respect to the value of `objective_function
<GradientOptimization.objective_function>` it generates, and return the sample that generates either the
highest (**direction=*ASCENT*) or lowest (**direction=*DESCENT*) value.
highest (**direction** = *ASCENT*) or lowest (**direction** = *DESCENT*) value.
.. _GradientOptimization_Procedure:
Expand Down Expand Up @@ -1680,7 +1680,7 @@ def _validate_params(self, request_set, target_set=None, context=None):

@handle_external_context(fallback_most_recent=True)
def reset(self, search_space, context=None, **kwargs):
"""Assign size of `search_space <GridSearch.search_space>"""
"""Assign size of `search_space <GridSearch.search_space>`"""
super(GridSearch, self).reset(search_space=search_space, context=context, **kwargs)
sample_iterators = search_space
owner_str = ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3913,7 +3913,7 @@ class FitzHughNagumoIntegrator(IntegratorFunction): # -------------------------
.. _FitzHughNagumoIntegrator:
`function <FitzHughNagumoIntegrator._function>` returns one time step of integration of the `Fitzhugh-Nagumo model
https://en.wikipedia.org/wiki/FitzHugh–Nagumo_model>`_ of an excitable oscillator:
<https://en.wikipedia.org/wiki/FitzHugh–Nagumo_model>`_ of an excitable oscillator:
.. math::
time\\_constant_v \\frac{dv}{dt} = a_v * v^3 + (1 + threshold) * b_v * v^2 + (- threshold) * c_v * v^2 +
Expand Down Expand Up @@ -4059,7 +4059,7 @@ class FitzHughNagumoIntegrator(IntegratorFunction): # -------------------------
+---------------------------------------+------------------------------------------------+----------------------------------------------+------------------------------------+---------------------------------------------------------------+
|**FitzHughNagumoIntegrator Parameter** |`threshold <FitzHughNagumoIntegrator.threshold>`|`variable <FitzHughNagumoIntegrator.variable>`|`f_v <FitzHughNagumoIntegrator.f_v>`|`time_constant_v <FitzHughNagumoIntegrator.time_constant_v>` |
+---------------------------------------+------------------------------------------------+----------------------------------------------+-------------------------+--------------------------------------------------------------------------+
|**Gilzenrat Parameter** |a |:math:`f(X_1)` |:math:`w_{vX_1}` |:math:`T_{v}` |
|**Gilzenrat Parameter** |a | :math:`f(X_1)` | :math:`w_{vX_1}` | :math:`T_{v}` |
+---------------------------------------+------------------------------------------------+----------------------------------------------+------------------------------------+---------------------------------------------------------------+
The following FitzHughNagumoIntegrator parameter values must be set in the equation for :math:`\\frac{dw}{dt}`:
Expand Down
13 changes: 6 additions & 7 deletions psyneulink/core/components/functions/stateful/memoryfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ class ContentAddressableMemory(MemoryFunction): # ------------------------------
Since `memory <ContentAddressableMemory.memory>` was not intialized, the first call to the Function returns an
array of zeros, formatted as specified in **defaul_variable**. However, the input in the call to the Function
(``[[1,2]]``) is stored as an entry in `memory <EpisodicMemoryMechanism.memory>`::
(``[[1,2]]``) is stored as an entry in `memory <EpisodicMemoryMechanism.memory>`:
>>> c.memory
array([[[1., 2.]]])
Expand Down Expand Up @@ -833,7 +833,7 @@ class ContentAddressableMemory(MemoryFunction): # ------------------------------
noise : float, list, 2d array, or Function : default 0.0
specifies random value(s) added to `variable <ContentAddressableMemory.variable>` before storing in
`memory <ContentAddressableMemory.memory>`; if a list or 2d array, it must be the same shape as `variable
ContentAddressableMemory.variable>` (see `noise <ContentAddressableMemory.noise>` for details).
ContentAddressableMemory.variable>` (see `noise <ContentAddressableMemory.noise>` for details).
initializer : 3d array or list : default None
specifies an initial set of entries for `memory <ContentAddressableMemory.memory>` (see
Expand Down Expand Up @@ -1028,8 +1028,7 @@ class ContentAddressableMemory(MemoryFunction): # ------------------------------
Returns
-------
entry from `memory <ContentAddressableMemory.memory>` that best matches `variable
<ContentAddressableMemory.variable>` : 2d array
entry from `memory <ContentAddressableMemory.memory>` that best matches `variable <ContentAddressableMemory.variable>` : 2d array
if no retrieval occurs, an appropriately shaped zero-valued array is returned.
"""
Expand Down Expand Up @@ -1993,7 +1992,7 @@ class DictionaryMemory(MemoryFunction): # -------------------------------------
.. math::
variable[1] * rate + noise
If the number of entries exceeds `max_entries <DictionaryMemory.max_entries>, the first (oldest) item in
If the number of entries exceeds `max_entries <DictionaryMemory.max_entries>`, the first (oldest) item in
memory is deleted.
Arguments
Expand All @@ -2012,11 +2011,11 @@ class DictionaryMemory(MemoryFunction): # -------------------------------------
rate : float, list, or array : default 1.0
specifies a value used to multiply key (first item of `variable <DictionaryMemory.variable>`) before
storing in `memory <DictionaryMemory.memory>` (see `rate <DictionaryMemory.noise> for details).
storing in `memory <DictionaryMemory.memory>` (see `rate <DictionaryMemory.rate>` for details).
noise : float, list, array, or Function : default 0.0
specifies a random value added to key (first item of `variable <DictionaryMemory.variable>`) before
storing in `memory <DictionaryMemory.memory>` (see `noise <DictionaryMemory.noise> for details).
storing in `memory <DictionaryMemory.memory>` (see `noise <DictionaryMemory.noise>` for details).
initializer : 3d array or list : default None
specifies an initial set of entries for `memory <DictionaryMemory.memory>`. It must be of the following
Expand Down
10 changes: 5 additions & 5 deletions psyneulink/core/components/mechanisms/mechanism.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
<Component>`, that can be created using a constructor; a *function* is an attribute that contains a callable method
belonging to a Function, and that is executed when the Component to which the Function belongs is executed.
Functions are used to assign, store, and apply parameter values associated with their function (see `Function
<Function_Overview> for a more detailed explanation).
<Function_Overview>` for a more detailed explanation).
The parameters of a Mechanism's `function <Mechanism_Base.function>` are attributes of its `function
<Component.function>`, and can be accessed using standard "dot" notation for that object. For
Expand Down Expand Up @@ -988,12 +988,12 @@
Projections will not be executed (see `Lazy Evaluation <Component_Lazy_Updating>`), but its `function
<Port_Base.function>` will be.
- If the `value <Port_Base.value>` of a Port is specified, *neither its `afferent Projections <Port_Projections>`
- If the `value <Port_Base.value>` of a Port is specified, *neither* its `afferent Projections <Port_Projections>`
nor it `function <Port_Base.function>` will be executed.
- If the `variable <Port_base.variable>` and/or `value <Port_Base.value>` is specified for *all* of the
OutputPorts of a Mechanism, then it's function will not be executed, and the `value <Mechanism_Base.value>`
will retain its previous value (again in accord with `Lazy Evaluation <Component_Lazy_Updating>), though its
will retain its previous value (again in accord with `Lazy Evaluation <Component_Lazy_Updating>`), though its
OutputPorts *will* be executed using the assigned values, and it's `execution_count <Component_Execution_Count>`
and `num_executions <Component_Num_Executions>` attributes will be incremented (since the OutputPorts --
Components of the Mechanism -- executed).
Expand All @@ -1012,7 +1012,7 @@
*MAPPING_PROJECTION_PARAMS*, *CONTROL_PROJECTION_PARAMS*, etc.). The sub-dictionary can contain specifications that
apply to *all* Projections of that type and/or individual Projections. If the key of an entryis the name of a parameter
of the Projection (or its `function <Port_Base.function>`), the specified value applies to *all* Projections of that
type. Parameters for individual Projections are specified using the Projections or its `name <Projection_Base.name>
type. Parameters for individual Projections are specified using the Projections or its `name <Projection_Base.name>`
as the key, and a dictionary containing parameter specifications as its value.
.. note::
Expand Down Expand Up @@ -2358,7 +2358,7 @@ def execute(self,
.. technical_note::
Execution sequence:
* Handle initialization if `initialization_status <Compoonent.initialization_status> is
* Handle initialization if `initialization_status <Compoonent.initialization_status>` is
*ContextFlags.INITIALIZING*
* Assign any `Port-specific runtime params <_Mechanism_Runtime_Port_and_Projection_Param_Specification>`
to corresponding `runtime_params <Mechanism_Base.runtime_params>` dict.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class GatingMechanism(ControlMechanism):
modulation=MULTIPLICATIVE)
Subclass of `ModulatoryMechanism <ModulatoryMechanism>` that gates (modulates) the value(s) of one or more `Ports
<Port>`. See `Mechanism <Mechanism_Class_Reference>` for additional arguments and attributes.
<Port>`. See `Mechanism <Mechanism_Class_Reference>` for additional arguments and attributes.
COMMENT:
Description:
Expand Down Expand Up @@ -284,7 +284,7 @@ class GatingMechanism(ControlMechanism):
specifies the `InputPorts <InputPort>` and/or `OutputPorts <OutputPorts>` to be gated by the
GatingMechanism; the number of items must equal the length of the **default_gating_allocation**
argument; if a `Mechanism <Mechanism>` is specified, its `primary InputPort <InputPort_Primary>`
is used (see `GatingMechanism_GatingSignals for details).
is used (see `GatingMechanism_GatingSignals` for details).
modulation : str : MULTIPLICATIVE
specifies the default form of modulation used by the GatingMechanism's `GatingSignals <GatingSignal>`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1940,7 +1940,7 @@ def _validate_params(self, request_set, target_set=None, context=None):
def _instantiate_input_ports(self, context=None):
"""Instantiate InputPorts for state_features (with state_feature_function if specified).
This instantiates the OptimizationControlMechanism's `state_input_ports;
This instantiates the OptimizationControlMechanism's `state_input_ports`;
these are used to provide input to the agent_rep when its evaluate method is called
The OptimizationControlMechanism's outcome_input_ports are instantiated by
ControlMechanism._instantiate_input_ports in the call to super().
Expand Down Expand Up @@ -3703,7 +3703,7 @@ def state_distal_sources_and_destinations_dict(self):

@property
def state_feature_sources(self):
"""Dict with {InputPort: source} for all INPUT Nodes of agent_rep, and sources in **state_feature_specs.
"""Dict with {InputPort: source} for all INPUT Nodes of agent_rep, and sources in **state_feature_specs**.
Used by state_distal_sources_and_destinations_dict()
"""
state_dict = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ class LearningMechanism(ModulatoryMechanism_Base):
the values of the InputPorts to which the `covariates_sources <LearningMechanism.covariates_sources>` project;
passed to the LearningMechanism's `function <LearningMechanism.function>` as the *COVARIATES* item of its
`variable <LearningMechanism.variable>`, and assigned as the `value <InputPort.value>` of the LearningMechanism's
*COVARIATES* `InputPort <LearningMechanism_Covariates>`s.
*COVARIATES* `InputPorts <LearningMechanism_Covariates>`.
error_sources : list[ComparatorMechanism or LearningMechanism]
the Mechanism(s) that calculate the error signal(s) provided to the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
- `ControlSignal_Modulation`
- `ControlSignal_Allocation_and_Intensity`
- `ControlSignal_Costs`
* `ControlSignal_Execution`d
* `ControlSignal_Execution`
* `ControlSignal_Examples`
* `ControlSignal_Class_Reference`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
.. _LearningSignal_Creation:
Creating a LearningSignal
------------------------
-------------------------
A LearningSignal is created automatically whenever a `MappingProjection` is `specified for learning
<LearningMechanism_Creation>` and the Projection belongs to the same `Composition <Composition>` as the
Expand Down
Loading

0 comments on commit 022c5b7

Please sign in to comment.