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

refactor/linearmatrix_matrixtransform #3101

Merged
merged 23 commits into from
Nov 6, 2024

Conversation

jdcpni
Copy link
Collaborator

@jdcpni jdcpni commented Nov 6, 2024

• transferfunctions.py

rename LinearCombination as MatrixTransform and move to transformfunctions.py
• transformfunctions

add MatrixTransform
MatrixTransform: add operation parameter
• combinationfunctions(.py) -> transformfunctions(.py)

• recurrenttransfermechanism.py

  • correct names for standard_outputports ENERGY and ENTROPY

• lccontrolmechanism.py:

  • add keywords for modulable fitzhugh-nagumo params

• emcomposition.py:

use MatrixTransform(operation=L0) w/o normalization for retrieval if len(key)==1
• 'EGO Model - CSW with Simple Integrator.py':

  • Younes' script corrections, now functions propery!

jdcpni added 20 commits October 27, 2024 08:18
…Link into devel

# Conflicts:
#	Scripts/Models (Under Development)/EGO/Using EMComposition/ScriptControl.py
#	Scripts/Models (Under Development)/EGO/Using EMComposition/TestParams.py
  - LinearMatrix -> LinearTransform
  PASSES ALL TESTS
  - rename LinearCombination as LinearTransform and move to combinationfunctions.py

• combinationfunctions.py
  - add LinearTransform

PASSES ALL TESTS
• transformfunctions.py
  LinearTransform -> MatrixTransform
  LinearTransform -> MatrixTransform
• transformfunctions.py
  MatrixTransform(): add operation parameter
• transformfunctions.py
  MatrixTransform(): add operation parameter
• emcomposition.py:
  use MatrixTransform(operation=L0) for retrieval if len(key)==1
• 'EGO Model - CSW with Simple Integrator.py':
  - Younes' script corrections, now functions propery!
• emcomposition.py:
  use MatrixTransform(operation=L0) for retrieval if len(key)==1
• lccontrontrolmechanism.py
  - add keywords for modulable params of fct
• recurrenttransfermechanism.py
  - correct names for standard_outputports ENERGY and ENTROPY

• lccontrolmechanism.py:
  - add keywords for modulable fitzhugh-nagumo params
…Link into refactor/linearmatrix_>matrixtransform

# Conflicts:
#	psyneulink/library/compositions/emcomposition.py
#	tests/ports/test_input_ports.py
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link

github-actions bot commented Nov 6, 2024

This PR causes the following changes to the html docs (ubuntu-latest-3.11):

diff -r docs-base/AutoAssociativeProjection.html docs-head/AutoAssociativeProjection.html
247c247
< determined by the format of the output of the RecurrentTransferMechanism, the <a class="reference internal" href="LCControlMechanism.html#psyneulink.library.components.mechanisms.modulatory.control.agt.lccontrolmechanism.LCControlMechanism.function" title="psyneulink.library.components.mechanisms.modulatory.control.agt.lccontrolmechanism.LCControlMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> is always LinearMatrix, and so
---
> determined by the format of the output of the RecurrentTransferMechanism, the <a class="reference internal" href="LCControlMechanism.html#psyneulink.library.components.mechanisms.modulatory.control.agt.lccontrolmechanism.LCControlMechanism.function" title="psyneulink.library.components.mechanisms.modulatory.control.agt.lccontrolmechanism.LCControlMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> is always MatrixTransform, and so
297c297
< <li><p><strong>matrix</strong> (<em>list</em><em>, </em><em>np.ndarray</em><em>, </em><em>function</em><em> or </em><em>keyword : default DEFAULT_MATRIX</em>) – specifies the matrix used by <a class="reference internal" href="Projection.html#psyneulink.core.components.projections.projection.Projection_Base.function" title="psyneulink.core.components.projections.projection.Projection_Base.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> (default: <a class="reference internal" href="CombinationFunctions.html#psyneulink.core.components.functions.combinationfunctions.LinearCombination" title="psyneulink.core.components.functions.combinationfunctions.LinearCombination"><code class="xref any py py-class docutils literal notranslate"><span class="pre">LinearCombination</span></code></a>) to
---
> <li><p><strong>matrix</strong> (<em>list</em><em>, </em><em>np.ndarray</em><em>, </em><em>function</em><em> or </em><em>keyword : default DEFAULT_MATRIX</em>) – specifies the matrix used by <a class="reference internal" href="Projection.html#psyneulink.core.components.projections.projection.Projection_Base.function" title="psyneulink.core.components.projections.projection.Projection_Base.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> (default: <code class="xref any docutils literal notranslate"><span class="pre">LinearCombination</span></code>) to
diff -r docs-base/CombinationFunctions.html docs-head/CombinationFunctions.html
204,1221d203
< <span class="target" id="module-psyneulink.core.components.functions.combinationfunctions"></span><ul class="simple">
< <li><p><a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate" title="psyneulink.core.components.functions.combinationfunctions.Concatenate"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Concatenate</span></code></a></p></li>
< <li><p><a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Rearrange" title="psyneulink.core.components.functions.combinationfunctions.Rearrange"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Rearrange</span></code></a></p></li>
< <li><p><a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Reduce" title="psyneulink.core.components.functions.combinationfunctions.Reduce"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Reduce</span></code></a></p></li>
< <li><p><a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.LinearCombination" title="psyneulink.core.components.functions.combinationfunctions.LinearCombination"><code class="xref any py py-class docutils literal notranslate"><span class="pre">LinearCombination</span></code></a></p></li>
< <li><p><a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.CombineMeans" title="psyneulink.core.components.functions.combinationfunctions.CombineMeans"><code class="xref any py py-class docutils literal notranslate"><span class="pre">CombineMeans</span></code></a></p></li>
< <li><p><a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.PredictionErrorDeltaFunction" title="psyneulink.core.components.functions.combinationfunctions.PredictionErrorDeltaFunction"><code class="xref any py py-class docutils literal notranslate"><span class="pre">PredictionErrorDeltaFunction</span></code></a></p></li>
< </ul>
< <section id="overview">
< <h2>Overview<a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h2>
< <p>Functions that combine multiple items with the same shape, yielding a result with a single item that has the same
< shape as the individual items.</p>
< <p>All CombinationFunctions must have two attributes - <strong>multiplicative_param</strong> and <strong>additive_param</strong> -
< each of which is assigned the name of one of the function’s parameters;
< this is for use by ModulatoryProjections (and, in particular, GatingProjections,
< when the CombinationFunction is used as the function of an InputPort or OutputPort).</p>
< <dl class="py class">
< <dt class="sig sig-object py" id="psyneulink.core.components.functions.combinationfunctions.Concatenate">
< <em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">psyneulink.core.components.functions.combinationfunctions.</span></span><span class="sig-name descname"><span class="pre">Concatenate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">default_variable</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">scale</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">offset</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">owner</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prefs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate" title="Permalink to this definition">¶</a></dt>
< <dd><p id="concatenate">Concatenates items in outer dimension (axis 0) of <code class="xref any docutils literal notranslate"><span class="pre">variable</span></code> into a single array,
< optionally scaling and/or adding an offset to the result after concatenating.</p>
< <p><code class="xref any docutils literal notranslate"><span class="pre">function</span></code> returns a 1d array with length equal to the sum of the lengths of the items
< in <code class="xref any docutils literal notranslate"><span class="pre">variable</span></code>.</p>
< <p><a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.derivative" title="psyneulink.core.components.functions.combinationfunctions.Concatenate.derivative"><code class="xref any py py-meth docutils literal notranslate"><span class="pre">derivative</span></code></a> returns <code class="xref any docutils literal notranslate"><span class="pre">scale</span></code>.</p>
< <dl class="field-list simple">
< <dt class="field-odd">Parameters</dt>
< <dd class="field-odd"><ul class="simple">
< <li><p><strong>default_variable</strong> (<em>list</em><em> or </em><em>np.array : default class_defaults.variable</em>) – specifies a template for the value to be transformed and its default value;  all entries must be numeric.</p></li>
< <li><p><strong>scale</strong> (<em>float</em>) – specifies a value by which to multiply each element of the output of <code class="xref any docutils literal notranslate"><span class="pre">function</span></code>
< (see <a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.scale" title="psyneulink.core.components.functions.combinationfunctions.Concatenate.scale"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">scale</span></code></a> for details)</p></li>
< <li><p><strong>offset</strong> (<em>float</em>) – specifies a value to add to each element of the output of <code class="xref any docutils literal notranslate"><span class="pre">function</span></code>
< (see <a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.offset" title="psyneulink.core.components.functions.combinationfunctions.Concatenate.offset"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">offset</span></code></a> for details)</p></li>
< <li><p><strong>params</strong> (<em>Dict</em><em>[</em><em>param keyword: param value</em><em>] </em><em>: default None</em>) – a <a class="reference internal" href="ParameterPort.html#parameterport-specification"><span class="std std-ref">parameter dictionary</span></a> that specifies the parameters for the
< function.  Values specified for parameters in the dictionary override any assigned to those parameters in
< arguments of the constructor.</p></li>
< <li><p><strong>owner</strong> (<a class="reference internal" href="Component.html#psyneulink.core.components.component.Component" title="psyneulink.core.components.component.Component"><em>Component</em></a>) – <a class="reference internal" href="Component.html"><span class="doc">component</span></a> to which to assign the Function.</p></li>
< <li><p><strong>name</strong> (str : default see <code class="xref any docutils literal notranslate"><span class="pre">name</span></code>) – specifies the name of the Function.</p></li>
< <li><p><strong>prefs</strong> (<em>PreferenceSet</em><em> or </em><em>specification dict : default Function.classPreferences</em>) – specifies the <code class="xref any docutils literal notranslate"><span class="pre">PreferenceSet</span></code> for the Function (see <a class="reference internal" href="Functions.html#psyneulink.core.components.functions.function.Function_Base.prefs" title="psyneulink.core.components.functions.function.Function_Base.prefs"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">prefs</span></code></a> for details).</p></li>
< </ul>
< </dd>
< </dl>
< <dl class="py attribute">
< <dt class="sig sig-object py" id="psyneulink.core.components.functions.combinationfunctions.Concatenate.default_variable">
< <span class="sig-name descname"><span class="pre">default_variable</span></span><a class="headerlink" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.default_variable" title="Permalink to this definition">¶</a></dt>
< <dd><p>contains template of array(s) to be concatenated.</p>
< <dl class="field-list simple">
< <dt class="field-odd">Type</dt>
< <dd class="field-odd"><p>list or np.array</p>
< </dd>
< </dl>
< </dd></dl>
< 
< <dl class="py attribute">
< <dt class="sig sig-object py" id="psyneulink.core.components.functions.combinationfunctions.Concatenate.scale">
< <span class="sig-name descname"><span class="pre">scale</span></span><a class="headerlink" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.scale" title="Permalink to this definition">¶</a></dt>
< <dd><p>value is applied multiplicatively to each element of the concatenated, before  applying the <a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.offset" title="psyneulink.core.components.functions.combinationfunctions.Concatenate.offset"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">offset</span></code></a> (if it is specified).</p>
< <dl class="field-list simple">
< <dt class="field-odd">Type</dt>
< <dd class="field-odd"><p>float</p>
< </dd>
< </dl>
< </dd></dl>
< 
< <dl class="py attribute">
< <dt class="sig sig-object py" id="psyneulink.core.components.functions.combinationfunctions.Concatenate.offset">
< <span class="sig-name descname"><span class="pre">offset</span></span><a class="headerlink" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.offset" title="Permalink to this definition">¶</a></dt>
< <dd><p>value is added to each element of the concatentated array, after <a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.scale" title="psyneulink.core.components.functions.combinationfunctions.Concatenate.scale"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">scale</span></code></a> has been
< applied (if it is specified).</p>
< <dl class="field-list simple">
< <dt class="field-odd">Type</dt>
< <dd class="field-odd"><p>float</p>
< </dd>
< </dl>
< </dd></dl>
< 
< <dl class="py attribute">
< <dt class="sig sig-object py" id="psyneulink.core.components.functions.combinationfunctions.Concatenate.owner">
< <span class="sig-name descname"><span class="pre">owner</span></span><a class="headerlink" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.owner" title="Permalink to this definition">¶</a></dt>
< <dd><p><a class="reference internal" href="Component.html"><span class="doc">component</span></a> to which the Function has been assigned.</p>
< <dl class="field-list simple">
< <dt class="field-odd">Type</dt>
< <dd class="field-odd"><p><a class="reference internal" href="Component.html#psyneulink.core.components.component.Component" title="psyneulink.core.components.component.Component">Component</a></p>
< </dd>
< </dl>
< </dd></dl>
< 
< <dl class="py attribute">
< <dt class="sig sig-object py" id="psyneulink.core.components.functions.combinationfunctions.Concatenate.name">
< <span class="sig-name descname"><span class="pre">name</span></span><a class="headerlink" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.name" title="Permalink to this definition">¶</a></dt>
< <dd><p>the name of the Function; if it is not specified in the <strong>name</strong> argument of the constructor, a default is
< assigned by FunctionRegistry (see <a class="reference internal" href="Registry.html#registry-naming"><span class="std std-ref">Naming</span></a> for conventions used for default and duplicate names).</p>
< <dl class="field-list simple">
< <dt class="field-odd">Type</dt>
< <dd class="field-odd"><p>str</p>
< </dd>
< </dl>
< </dd></dl>
< 
< <dl class="py attribute">
< <dt class="sig sig-object py" id="psyneulink.core.components.functions.combinationfunctions.Concatenate.prefs">
< <span class="sig-name descname"><span class="pre">prefs</span></span><a class="headerlink" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.prefs" title="Permalink to this definition">¶</a></dt>
< <dd><p>the <code class="xref any docutils literal notranslate"><span class="pre">PreferenceSet</span></code> for function; if it is not specified in the <strong>prefs</strong> argument of the Function’s
< constructor, a default is assigned using <code class="xref any docutils literal notranslate"><span class="pre">classPreferences</span></code> defined in __init__.py (see <a class="reference internal" href="Preferences.html"><span class="doc">Preferences</span></a> for
< details).</p>
< <dl class="field-list simple">
< <dt class="field-odd">Type</dt>
< <dd class="field-odd"><p>PreferenceS
...

See CI logs for the full diff.

Copy link

github-actions bot commented Nov 6, 2024

This PR causes the following changes to the html docs (ubuntu-latest-3.11):

diff -r docs-base/AutoAssociativeProjection.html docs-head/AutoAssociativeProjection.html
247c247
< determined by the format of the output of the RecurrentTransferMechanism, the <a class="reference internal" href="LCControlMechanism.html#psyneulink.library.components.mechanisms.modulatory.control.agt.lccontrolmechanism.LCControlMechanism.function" title="psyneulink.library.components.mechanisms.modulatory.control.agt.lccontrolmechanism.LCControlMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> is always LinearMatrix, and so
---
> determined by the format of the output of the RecurrentTransferMechanism, the <a class="reference internal" href="LCControlMechanism.html#psyneulink.library.components.mechanisms.modulatory.control.agt.lccontrolmechanism.LCControlMechanism.function" title="psyneulink.library.components.mechanisms.modulatory.control.agt.lccontrolmechanism.LCControlMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> is always MatrixTransform, and so
297c297
< <li><p><strong>matrix</strong> (<em>list</em><em>, </em><em>np.ndarray</em><em>, </em><em>function</em><em> or </em><em>keyword : default DEFAULT_MATRIX</em>) – specifies the matrix used by <a class="reference internal" href="Projection.html#psyneulink.core.components.projections.projection.Projection_Base.function" title="psyneulink.core.components.projections.projection.Projection_Base.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> (default: <a class="reference internal" href="CombinationFunctions.html#psyneulink.core.components.functions.combinationfunctions.LinearCombination" title="psyneulink.core.components.functions.combinationfunctions.LinearCombination"><code class="xref any py py-class docutils literal notranslate"><span class="pre">LinearCombination</span></code></a>) to
---
> <li><p><strong>matrix</strong> (<em>list</em><em>, </em><em>np.ndarray</em><em>, </em><em>function</em><em> or </em><em>keyword : default DEFAULT_MATRIX</em>) – specifies the matrix used by <a class="reference internal" href="Projection.html#psyneulink.core.components.projections.projection.Projection_Base.function" title="psyneulink.core.components.projections.projection.Projection_Base.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> (default: <code class="xref any docutils literal notranslate"><span class="pre">LinearCombination</span></code>) to
diff -r docs-base/CombinationFunctions.html docs-head/CombinationFunctions.html
204,1221d203
< <span class="target" id="module-psyneulink.core.components.functions.combinationfunctions"></span><ul class="simple">
< <li><p><a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate" title="psyneulink.core.components.functions.combinationfunctions.Concatenate"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Concatenate</span></code></a></p></li>
< <li><p><a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Rearrange" title="psyneulink.core.components.functions.combinationfunctions.Rearrange"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Rearrange</span></code></a></p></li>
< <li><p><a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Reduce" title="psyneulink.core.components.functions.combinationfunctions.Reduce"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Reduce</span></code></a></p></li>
< <li><p><a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.LinearCombination" title="psyneulink.core.components.functions.combinationfunctions.LinearCombination"><code class="xref any py py-class docutils literal notranslate"><span class="pre">LinearCombination</span></code></a></p></li>
< <li><p><a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.CombineMeans" title="psyneulink.core.components.functions.combinationfunctions.CombineMeans"><code class="xref any py py-class docutils literal notranslate"><span class="pre">CombineMeans</span></code></a></p></li>
< <li><p><a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.PredictionErrorDeltaFunction" title="psyneulink.core.components.functions.combinationfunctions.PredictionErrorDeltaFunction"><code class="xref any py py-class docutils literal notranslate"><span class="pre">PredictionErrorDeltaFunction</span></code></a></p></li>
< </ul>
< <section id="overview">
< <h2>Overview<a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h2>
< <p>Functions that combine multiple items with the same shape, yielding a result with a single item that has the same
< shape as the individual items.</p>
< <p>All CombinationFunctions must have two attributes - <strong>multiplicative_param</strong> and <strong>additive_param</strong> -
< each of which is assigned the name of one of the function’s parameters;
< this is for use by ModulatoryProjections (and, in particular, GatingProjections,
< when the CombinationFunction is used as the function of an InputPort or OutputPort).</p>
< <dl class="py class">
< <dt class="sig sig-object py" id="psyneulink.core.components.functions.combinationfunctions.Concatenate">
< <em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">psyneulink.core.components.functions.combinationfunctions.</span></span><span class="sig-name descname"><span class="pre">Concatenate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">default_variable</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">scale</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">offset</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">owner</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prefs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate" title="Permalink to this definition">¶</a></dt>
< <dd><p id="concatenate">Concatenates items in outer dimension (axis 0) of <code class="xref any docutils literal notranslate"><span class="pre">variable</span></code> into a single array,
< optionally scaling and/or adding an offset to the result after concatenating.</p>
< <p><code class="xref any docutils literal notranslate"><span class="pre">function</span></code> returns a 1d array with length equal to the sum of the lengths of the items
< in <code class="xref any docutils literal notranslate"><span class="pre">variable</span></code>.</p>
< <p><a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.derivative" title="psyneulink.core.components.functions.combinationfunctions.Concatenate.derivative"><code class="xref any py py-meth docutils literal notranslate"><span class="pre">derivative</span></code></a> returns <code class="xref any docutils literal notranslate"><span class="pre">scale</span></code>.</p>
< <dl class="field-list simple">
< <dt class="field-odd">Parameters</dt>
< <dd class="field-odd"><ul class="simple">
< <li><p><strong>default_variable</strong> (<em>list</em><em> or </em><em>np.array : default class_defaults.variable</em>) – specifies a template for the value to be transformed and its default value;  all entries must be numeric.</p></li>
< <li><p><strong>scale</strong> (<em>float</em>) – specifies a value by which to multiply each element of the output of <code class="xref any docutils literal notranslate"><span class="pre">function</span></code>
< (see <a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.scale" title="psyneulink.core.components.functions.combinationfunctions.Concatenate.scale"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">scale</span></code></a> for details)</p></li>
< <li><p><strong>offset</strong> (<em>float</em>) – specifies a value to add to each element of the output of <code class="xref any docutils literal notranslate"><span class="pre">function</span></code>
< (see <a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.offset" title="psyneulink.core.components.functions.combinationfunctions.Concatenate.offset"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">offset</span></code></a> for details)</p></li>
< <li><p><strong>params</strong> (<em>Dict</em><em>[</em><em>param keyword: param value</em><em>] </em><em>: default None</em>) – a <a class="reference internal" href="ParameterPort.html#parameterport-specification"><span class="std std-ref">parameter dictionary</span></a> that specifies the parameters for the
< function.  Values specified for parameters in the dictionary override any assigned to those parameters in
< arguments of the constructor.</p></li>
< <li><p><strong>owner</strong> (<a class="reference internal" href="Component.html#psyneulink.core.components.component.Component" title="psyneulink.core.components.component.Component"><em>Component</em></a>) – <a class="reference internal" href="Component.html"><span class="doc">component</span></a> to which to assign the Function.</p></li>
< <li><p><strong>name</strong> (str : default see <code class="xref any docutils literal notranslate"><span class="pre">name</span></code>) – specifies the name of the Function.</p></li>
< <li><p><strong>prefs</strong> (<em>PreferenceSet</em><em> or </em><em>specification dict : default Function.classPreferences</em>) – specifies the <code class="xref any docutils literal notranslate"><span class="pre">PreferenceSet</span></code> for the Function (see <a class="reference internal" href="Functions.html#psyneulink.core.components.functions.function.Function_Base.prefs" title="psyneulink.core.components.functions.function.Function_Base.prefs"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">prefs</span></code></a> for details).</p></li>
< </ul>
< </dd>
< </dl>
< <dl class="py attribute">
< <dt class="sig sig-object py" id="psyneulink.core.components.functions.combinationfunctions.Concatenate.default_variable">
< <span class="sig-name descname"><span class="pre">default_variable</span></span><a class="headerlink" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.default_variable" title="Permalink to this definition">¶</a></dt>
< <dd><p>contains template of array(s) to be concatenated.</p>
< <dl class="field-list simple">
< <dt class="field-odd">Type</dt>
< <dd class="field-odd"><p>list or np.array</p>
< </dd>
< </dl>
< </dd></dl>
< 
< <dl class="py attribute">
< <dt class="sig sig-object py" id="psyneulink.core.components.functions.combinationfunctions.Concatenate.scale">
< <span class="sig-name descname"><span class="pre">scale</span></span><a class="headerlink" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.scale" title="Permalink to this definition">¶</a></dt>
< <dd><p>value is applied multiplicatively to each element of the concatenated, before  applying the <a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.offset" title="psyneulink.core.components.functions.combinationfunctions.Concatenate.offset"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">offset</span></code></a> (if it is specified).</p>
< <dl class="field-list simple">
< <dt class="field-odd">Type</dt>
< <dd class="field-odd"><p>float</p>
< </dd>
< </dl>
< </dd></dl>
< 
< <dl class="py attribute">
< <dt class="sig sig-object py" id="psyneulink.core.components.functions.combinationfunctions.Concatenate.offset">
< <span class="sig-name descname"><span class="pre">offset</span></span><a class="headerlink" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.offset" title="Permalink to this definition">¶</a></dt>
< <dd><p>value is added to each element of the concatentated array, after <a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.scale" title="psyneulink.core.components.functions.combinationfunctions.Concatenate.scale"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">scale</span></code></a> has been
< applied (if it is specified).</p>
< <dl class="field-list simple">
< <dt class="field-odd">Type</dt>
< <dd class="field-odd"><p>float</p>
< </dd>
< </dl>
< </dd></dl>
< 
< <dl class="py attribute">
< <dt class="sig sig-object py" id="psyneulink.core.components.functions.combinationfunctions.Concatenate.owner">
< <span class="sig-name descname"><span class="pre">owner</span></span><a class="headerlink" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.owner" title="Permalink to this definition">¶</a></dt>
< <dd><p><a class="reference internal" href="Component.html"><span class="doc">component</span></a> to which the Function has been assigned.</p>
< <dl class="field-list simple">
< <dt class="field-odd">Type</dt>
< <dd class="field-odd"><p><a class="reference internal" href="Component.html#psyneulink.core.components.component.Component" title="psyneulink.core.components.component.Component">Component</a></p>
< </dd>
< </dl>
< </dd></dl>
< 
< <dl class="py attribute">
< <dt class="sig sig-object py" id="psyneulink.core.components.functions.combinationfunctions.Concatenate.name">
< <span class="sig-name descname"><span class="pre">name</span></span><a class="headerlink" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.name" title="Permalink to this definition">¶</a></dt>
< <dd><p>the name of the Function; if it is not specified in the <strong>name</strong> argument of the constructor, a default is
< assigned by FunctionRegistry (see <a class="reference internal" href="Registry.html#registry-naming"><span class="std std-ref">Naming</span></a> for conventions used for default and duplicate names).</p>
< <dl class="field-list simple">
< <dt class="field-odd">Type</dt>
< <dd class="field-odd"><p>str</p>
< </dd>
< </dl>
< </dd></dl>
< 
< <dl class="py attribute">
< <dt class="sig sig-object py" id="psyneulink.core.components.functions.combinationfunctions.Concatenate.prefs">
< <span class="sig-name descname"><span class="pre">prefs</span></span><a class="headerlink" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.prefs" title="Permalink to this definition">¶</a></dt>
< <dd><p>the <code class="xref any docutils literal notranslate"><span class="pre">PreferenceSet</span></code> for function; if it is not specified in the <strong>prefs</strong> argument of the Function’s
< constructor, a default is assigned using <code class="xref any docutils literal notranslate"><span class="pre">classPreferences</span></code> defined in __init__.py (see <a class="reference internal" href="Preferences.html"><span class="doc">Preferences</span></a> for
< details).</p>
< <dl class="field-list simple">
< <dt class="field-odd">Type</dt>
< <dd class="field-odd"><p>PreferenceS
...

See CI logs for the full diff.

@coveralls
Copy link

coveralls commented Nov 6, 2024

Coverage Status

coverage: 83.849% (+0.007%) from 83.842%
when pulling 266cb06 on refactor/linearmatrix_matrixtransform
into 13128b5 on devel.

Copy link

github-actions bot commented Nov 6, 2024

This PR causes the following changes to the html docs (ubuntu-latest-3.11):

diff -r docs-base/AutoAssociativeProjection.html docs-head/AutoAssociativeProjection.html
247c247
< determined by the format of the output of the RecurrentTransferMechanism, the <a class="reference internal" href="LCControlMechanism.html#psyneulink.library.components.mechanisms.modulatory.control.agt.lccontrolmechanism.LCControlMechanism.function" title="psyneulink.library.components.mechanisms.modulatory.control.agt.lccontrolmechanism.LCControlMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> is always LinearMatrix, and so
---
> determined by the format of the output of the RecurrentTransferMechanism, the <a class="reference internal" href="LCControlMechanism.html#psyneulink.library.components.mechanisms.modulatory.control.agt.lccontrolmechanism.LCControlMechanism.function" title="psyneulink.library.components.mechanisms.modulatory.control.agt.lccontrolmechanism.LCControlMechanism.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> is always MatrixTransform, and so
297c297
< <li><p><strong>matrix</strong> (<em>list</em><em>, </em><em>np.ndarray</em><em>, </em><em>function</em><em> or </em><em>keyword : default DEFAULT_MATRIX</em>) – specifies the matrix used by <a class="reference internal" href="Projection.html#psyneulink.core.components.projections.projection.Projection_Base.function" title="psyneulink.core.components.projections.projection.Projection_Base.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> (default: <a class="reference internal" href="CombinationFunctions.html#psyneulink.core.components.functions.combinationfunctions.LinearCombination" title="psyneulink.core.components.functions.combinationfunctions.LinearCombination"><code class="xref any py py-class docutils literal notranslate"><span class="pre">LinearCombination</span></code></a>) to
---
> <li><p><strong>matrix</strong> (<em>list</em><em>, </em><em>np.ndarray</em><em>, </em><em>function</em><em> or </em><em>keyword : default DEFAULT_MATRIX</em>) – specifies the matrix used by <a class="reference internal" href="Projection.html#psyneulink.core.components.projections.projection.Projection_Base.function" title="psyneulink.core.components.projections.projection.Projection_Base.function"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">function</span></code></a> (default: <code class="xref any docutils literal notranslate"><span class="pre">LinearCombination</span></code>) to
diff -r docs-base/CombinationFunctions.html docs-head/CombinationFunctions.html
204,1221d203
< <span class="target" id="module-psyneulink.core.components.functions.combinationfunctions"></span><ul class="simple">
< <li><p><a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate" title="psyneulink.core.components.functions.combinationfunctions.Concatenate"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Concatenate</span></code></a></p></li>
< <li><p><a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Rearrange" title="psyneulink.core.components.functions.combinationfunctions.Rearrange"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Rearrange</span></code></a></p></li>
< <li><p><a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Reduce" title="psyneulink.core.components.functions.combinationfunctions.Reduce"><code class="xref any py py-class docutils literal notranslate"><span class="pre">Reduce</span></code></a></p></li>
< <li><p><a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.LinearCombination" title="psyneulink.core.components.functions.combinationfunctions.LinearCombination"><code class="xref any py py-class docutils literal notranslate"><span class="pre">LinearCombination</span></code></a></p></li>
< <li><p><a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.CombineMeans" title="psyneulink.core.components.functions.combinationfunctions.CombineMeans"><code class="xref any py py-class docutils literal notranslate"><span class="pre">CombineMeans</span></code></a></p></li>
< <li><p><a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.PredictionErrorDeltaFunction" title="psyneulink.core.components.functions.combinationfunctions.PredictionErrorDeltaFunction"><code class="xref any py py-class docutils literal notranslate"><span class="pre">PredictionErrorDeltaFunction</span></code></a></p></li>
< </ul>
< <section id="overview">
< <h2>Overview<a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h2>
< <p>Functions that combine multiple items with the same shape, yielding a result with a single item that has the same
< shape as the individual items.</p>
< <p>All CombinationFunctions must have two attributes - <strong>multiplicative_param</strong> and <strong>additive_param</strong> -
< each of which is assigned the name of one of the function’s parameters;
< this is for use by ModulatoryProjections (and, in particular, GatingProjections,
< when the CombinationFunction is used as the function of an InputPort or OutputPort).</p>
< <dl class="py class">
< <dt class="sig sig-object py" id="psyneulink.core.components.functions.combinationfunctions.Concatenate">
< <em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">psyneulink.core.components.functions.combinationfunctions.</span></span><span class="sig-name descname"><span class="pre">Concatenate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">default_variable</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">scale</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">offset</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">params</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">owner</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prefs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate" title="Permalink to this definition">¶</a></dt>
< <dd><p id="concatenate">Concatenates items in outer dimension (axis 0) of <code class="xref any docutils literal notranslate"><span class="pre">variable</span></code> into a single array,
< optionally scaling and/or adding an offset to the result after concatenating.</p>
< <p><code class="xref any docutils literal notranslate"><span class="pre">function</span></code> returns a 1d array with length equal to the sum of the lengths of the items
< in <code class="xref any docutils literal notranslate"><span class="pre">variable</span></code>.</p>
< <p><a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.derivative" title="psyneulink.core.components.functions.combinationfunctions.Concatenate.derivative"><code class="xref any py py-meth docutils literal notranslate"><span class="pre">derivative</span></code></a> returns <code class="xref any docutils literal notranslate"><span class="pre">scale</span></code>.</p>
< <dl class="field-list simple">
< <dt class="field-odd">Parameters</dt>
< <dd class="field-odd"><ul class="simple">
< <li><p><strong>default_variable</strong> (<em>list</em><em> or </em><em>np.array : default class_defaults.variable</em>) – specifies a template for the value to be transformed and its default value;  all entries must be numeric.</p></li>
< <li><p><strong>scale</strong> (<em>float</em>) – specifies a value by which to multiply each element of the output of <code class="xref any docutils literal notranslate"><span class="pre">function</span></code>
< (see <a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.scale" title="psyneulink.core.components.functions.combinationfunctions.Concatenate.scale"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">scale</span></code></a> for details)</p></li>
< <li><p><strong>offset</strong> (<em>float</em>) – specifies a value to add to each element of the output of <code class="xref any docutils literal notranslate"><span class="pre">function</span></code>
< (see <a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.offset" title="psyneulink.core.components.functions.combinationfunctions.Concatenate.offset"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">offset</span></code></a> for details)</p></li>
< <li><p><strong>params</strong> (<em>Dict</em><em>[</em><em>param keyword: param value</em><em>] </em><em>: default None</em>) – a <a class="reference internal" href="ParameterPort.html#parameterport-specification"><span class="std std-ref">parameter dictionary</span></a> that specifies the parameters for the
< function.  Values specified for parameters in the dictionary override any assigned to those parameters in
< arguments of the constructor.</p></li>
< <li><p><strong>owner</strong> (<a class="reference internal" href="Component.html#psyneulink.core.components.component.Component" title="psyneulink.core.components.component.Component"><em>Component</em></a>) – <a class="reference internal" href="Component.html"><span class="doc">component</span></a> to which to assign the Function.</p></li>
< <li><p><strong>name</strong> (str : default see <code class="xref any docutils literal notranslate"><span class="pre">name</span></code>) – specifies the name of the Function.</p></li>
< <li><p><strong>prefs</strong> (<em>PreferenceSet</em><em> or </em><em>specification dict : default Function.classPreferences</em>) – specifies the <code class="xref any docutils literal notranslate"><span class="pre">PreferenceSet</span></code> for the Function (see <a class="reference internal" href="Functions.html#psyneulink.core.components.functions.function.Function_Base.prefs" title="psyneulink.core.components.functions.function.Function_Base.prefs"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">prefs</span></code></a> for details).</p></li>
< </ul>
< </dd>
< </dl>
< <dl class="py attribute">
< <dt class="sig sig-object py" id="psyneulink.core.components.functions.combinationfunctions.Concatenate.default_variable">
< <span class="sig-name descname"><span class="pre">default_variable</span></span><a class="headerlink" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.default_variable" title="Permalink to this definition">¶</a></dt>
< <dd><p>contains template of array(s) to be concatenated.</p>
< <dl class="field-list simple">
< <dt class="field-odd">Type</dt>
< <dd class="field-odd"><p>list or np.array</p>
< </dd>
< </dl>
< </dd></dl>
< 
< <dl class="py attribute">
< <dt class="sig sig-object py" id="psyneulink.core.components.functions.combinationfunctions.Concatenate.scale">
< <span class="sig-name descname"><span class="pre">scale</span></span><a class="headerlink" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.scale" title="Permalink to this definition">¶</a></dt>
< <dd><p>value is applied multiplicatively to each element of the concatenated, before  applying the <a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.offset" title="psyneulink.core.components.functions.combinationfunctions.Concatenate.offset"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">offset</span></code></a> (if it is specified).</p>
< <dl class="field-list simple">
< <dt class="field-odd">Type</dt>
< <dd class="field-odd"><p>float</p>
< </dd>
< </dl>
< </dd></dl>
< 
< <dl class="py attribute">
< <dt class="sig sig-object py" id="psyneulink.core.components.functions.combinationfunctions.Concatenate.offset">
< <span class="sig-name descname"><span class="pre">offset</span></span><a class="headerlink" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.offset" title="Permalink to this definition">¶</a></dt>
< <dd><p>value is added to each element of the concatentated array, after <a class="reference internal" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.scale" title="psyneulink.core.components.functions.combinationfunctions.Concatenate.scale"><code class="xref any py py-attr docutils literal notranslate"><span class="pre">scale</span></code></a> has been
< applied (if it is specified).</p>
< <dl class="field-list simple">
< <dt class="field-odd">Type</dt>
< <dd class="field-odd"><p>float</p>
< </dd>
< </dl>
< </dd></dl>
< 
< <dl class="py attribute">
< <dt class="sig sig-object py" id="psyneulink.core.components.functions.combinationfunctions.Concatenate.owner">
< <span class="sig-name descname"><span class="pre">owner</span></span><a class="headerlink" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.owner" title="Permalink to this definition">¶</a></dt>
< <dd><p><a class="reference internal" href="Component.html"><span class="doc">component</span></a> to which the Function has been assigned.</p>
< <dl class="field-list simple">
< <dt class="field-odd">Type</dt>
< <dd class="field-odd"><p><a class="reference internal" href="Component.html#psyneulink.core.components.component.Component" title="psyneulink.core.components.component.Component">Component</a></p>
< </dd>
< </dl>
< </dd></dl>
< 
< <dl class="py attribute">
< <dt class="sig sig-object py" id="psyneulink.core.components.functions.combinationfunctions.Concatenate.name">
< <span class="sig-name descname"><span class="pre">name</span></span><a class="headerlink" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.name" title="Permalink to this definition">¶</a></dt>
< <dd><p>the name of the Function; if it is not specified in the <strong>name</strong> argument of the constructor, a default is
< assigned by FunctionRegistry (see <a class="reference internal" href="Registry.html#registry-naming"><span class="std std-ref">Naming</span></a> for conventions used for default and duplicate names).</p>
< <dl class="field-list simple">
< <dt class="field-odd">Type</dt>
< <dd class="field-odd"><p>str</p>
< </dd>
< </dl>
< </dd></dl>
< 
< <dl class="py attribute">
< <dt class="sig sig-object py" id="psyneulink.core.components.functions.combinationfunctions.Concatenate.prefs">
< <span class="sig-name descname"><span class="pre">prefs</span></span><a class="headerlink" href="#psyneulink.core.components.functions.combinationfunctions.Concatenate.prefs" title="Permalink to this definition">¶</a></dt>
< <dd><p>the <code class="xref any docutils literal notranslate"><span class="pre">PreferenceSet</span></code> for function; if it is not specified in the <strong>prefs</strong> argument of the Function’s
< constructor, a default is assigned using <code class="xref any docutils literal notranslate"><span class="pre">classPreferences</span></code> defined in __init__.py (see <a class="reference internal" href="Preferences.html"><span class="doc">Preferences</span></a> for
< details).</p>
< <dl class="field-list simple">
< <dt class="field-odd">Type</dt>
< <dd class="field-odd"><p>PreferenceS
...

See CI logs for the full diff.

@jdcpni jdcpni merged commit 23e0ee1 into devel Nov 6, 2024
71 checks passed
@jdcpni jdcpni deleted the refactor/linearmatrix_matrixtransform branch November 6, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants