From 13f1092a7afdf3ddddaf5366ddf6b8d1080c0e99 Mon Sep 17 00:00:00 2001 From: kmantel Date: Tue, 3 Oct 2017 17:33:21 -0400 Subject: [PATCH] rename packages and modules to lowercase, and handle relevant import changes --- Scripts/DEBUGGING SCRIPTS/AGT Test Script.py | 12 ++-- .../EVC Gratton Script - SEBASTIAN.py | 12 ++-- ...n Test Script [SPECIFY ControlSignals]].py | 12 ++-- .../LCMechanism Test Script.py | 10 +-- ...ayer Learning Test Script [WITH GATING].py | 18 ++--- .../OLD/EVC Gratton Script_Bug1.py | 12 ++-- .../OLD/EVC Gratton Script_Bug2.py | 12 ++-- .../OLD/EVC Gratton Script_Bug3.py | 12 ++-- .../OLD/EVC Gratton Script_Bug4.py | 12 ++-- .../OLD/EVC Gratton Script_Bug5.py | 12 ++-- ...Laming Validation Test Script DEBUGGING.py | 12 ++-- ...aming Validation Test Script VARIATIONS.py | 12 ++-- .../OLD/EVC_Gratton_Script_Validation.py | 12 ++-- ...tilayer Learning Test Script VARIATIONS.py | 12 ++-- ...RIPTS_EVC_Gratton_Script_-_SEBASTIAN_py.py | 12 ++-- .../OLD/Sebastian's Multitasking Model.py | 8 +-- ...roop Model Learning Test Script - EQUAL.py | 10 +-- ... Model Learning and Control Test Script.py | 12 ++-- .../Stroop Model Test Script VARIATIONS.py | 8 +-- .../DEBUGGING SCRIPTS/OLD/StroopEVCforDST.py | 8 +-- .../OLD/Stroop_model_markus.py | 8 +-- .../assign_inputs_to_composition.py | 10 +-- Scripts/DEMO SCRIPTS/DDM_scheduled_simple.py | 16 ++--- .../DDM_scheduled_simple_limited_calls.py | 16 ++--- .../DEMO SCRIPTS/EVC System DEMO Script.py | 14 ++-- .../Integrator_scheduled_timescales.py | 16 ++--- .../Mixed NN & DDM DEMO Script.py | 6 +- .../Multilayer Learning Test Script DEMO.py | 10 +-- Scripts/DEMO SCRIPTS/NEW_Learning_Markus.py | 8 +-- .../Stroop Demo Script with Learning.py | 10 +-- Scripts/DEMO SCRIPTS/Stroop Demo Script.py | 10 +-- .../DEMO SCRIPTS/Xor_Script_2_processes.py | 8 +-- .../DEMO SCRIPTS/Xor_Script_NotYetWorking.py | 8 +-- Scripts/DEMO SCRIPTS/Xor_Script_Working.py | 8 +-- .../DEMO SCRIPTS/documentation_examples.py | 40 +++++------ .../DEMO SCRIPTS/mechanism-function-plots.py | 2 +- Scripts/DEMO SCRIPTS/noise-plots-dynamic.py | 2 +- .../ComparatorTestScript.py | 4 +- .../DDM Learning Test Script.py | 8 +-- .../DDM Test Script (simple).py | 2 +- ...stem Laming Validation Test Script COPY.py | 12 ++-- ...g Validation Test Script with Custom Fn.py | 12 ++-- .../EVC System Test Script (with MPI).py | 12 ++-- .../EVC System Test Script with Profiler.py | 10 +-- .../Integrator-test-script.py | 4 +- .../Learning Signal Test Script.py | 8 +-- ...Multilayer Learning Test Script (CLEAN).py | 10 +-- .../Process Initialization Test Script.py | 6 +- ...forcement Learning Test Script [SIMPLE].py | 12 ++-- .../MISCELLANEOUS SCRIPTS/SEBASTIAN SCRIPT.py | 12 ++-- .../System Learning Test Script.py | 8 +-- .../System Test Script.py | 8 +-- Scripts/MISCELLANEOUS SCRIPTS/Test Script.py | 4 +- .../Transfer Mechanism Test Script.py | 6 +- .../MISCELLANEOUS SCRIPTS/TutorialScript.py | 4 +- .../Two Layer Test Script.py | 8 +-- Scripts/MISCELLANEOUS SCRIPTS/ddm-bug.py | 6 +- .../mechanism-generator-test.py | 10 +-- Scripts/MISCELLANEOUS SCRIPTS/rate_bug.py | 14 ++-- .../testing_mechanisms.py | 16 ++--- Scripts/Models/GilzenratModel.py | 22 +++--- Scripts/Scratch Pad.py | 12 ++-- Scripts/TEST SCRIPTS/DDM Test Script.py | 4 +- .../Documentation Examples Script.py | 20 +++--- ...VC System Laming Validation Test Script.py | 18 ++--- Scripts/TEST SCRIPTS/META Test Script.py | 2 +- Scripts/TEST SCRIPTS/Mixed NN & DDM script.py | 10 +-- .../Multilayer Learning Test Script.py | 18 ++--- .../Reinforcement Learning Test Script.py | 14 ++-- .../Stroop Model Learning Test Script.py | 12 ++-- .../TEST SCRIPTS/Stroop Model Test Script.py | 10 +-- .../System Graph and Input Test Script.py | 6 +- {PsyNeuLink => psyneulink}/__init__.py | 30 ++++---- .../components}/__init__.py | 50 ++++++------- .../components/component.py | 44 ++++++------ .../components/functions}/__init__.py | 0 .../components/functions/function.py | 40 +++++------ .../components/mechanisms}/__init__.py | 0 .../mechanisms/adaptive}/__init__.py | 0 .../mechanisms/adaptive/adaptivemechanism.py | 8 +-- .../mechanisms/adaptive/control}/__init__.py | 0 .../adaptive/control/controlmechanism.py | 54 +++++++------- .../control/defaultcontrolmechanism.py | 28 ++++---- .../mechanisms/adaptive/gating}/__init__.py | 0 .../adaptive/gating/gatingmechanism.py | 34 ++++----- .../mechanisms/adaptive/learning}/__init__.py | 0 .../adaptive/learning/learningauxilliary.py | 26 +++---- .../adaptive/learning/learningmechanism.py | 50 ++++++------- .../components/mechanisms/mechanism.py | 58 +++++++-------- .../mechanisms/processing}/__init__.py | 0 .../compositioninterfacemechanism.py | 14 ++-- .../processing/defaultprocessingmechanism.py | 12 ++-- .../processing/integratormechanism.py | 12 ++-- .../processing/objectivemechanism.py | 34 ++++----- .../processing/processingmechanism.py | 6 +- .../processing/transfermechanism.py | 22 +++--- .../components/process.py | 56 +++++++-------- .../components/projections}/__init__.py | 0 .../projections/modulatory}/__init__.py | 0 .../modulatory/controlprojection.py | 24 +++---- .../modulatory/gatingprojection.py | 26 +++---- .../modulatory/learningprojection.py | 32 ++++----- .../modulatory/modulatoryprojection.py | 4 +- .../projections/pathway}/__init__.py | 0 .../projections/pathway/mappingprojection.py | 18 ++--- .../projections/pathway/pathwayprojection.py | 4 +- .../components/projections/projection.py | 40 +++++------ .../components/shellclasses.py | 2 +- .../components/states}/__init__.py | 0 .../components/states/inputstate.py | 14 ++-- .../states/modulatorysignals}/__init__.py | 0 .../states/modulatorysignals/controlsignal.py | 34 ++++----- .../states/modulatorysignals/gatingsignal.py | 26 +++---- .../modulatorysignals/learningsignal.py | 16 ++--- .../modulatorysignals/modulatorysignal.py | 14 ++-- .../components/states/outputstate.py | 24 +++---- .../components/states/parameterstate.py | 28 ++++---- .../components/states/state.py | 70 +++++++++---------- .../components/system.py | 66 ++++++++--------- .../composition.py | 12 ++-- .../globals}/__init__.py | 0 .../globals/defaults.py | 2 +- .../globals/keywords.py | 0 .../KVO.py => psyneulink/globals/kvo.py | 0 .../Log.py => psyneulink/globals/log.py | 2 +- .../globals/preferences}/__init__.py | 0 .../preferences/componentpreferenceset.py | 12 ++-- .../preferences/mechanismpreferenceset.py | 8 +-- .../globals/preferences/preferenceset.py | 16 ++--- .../globals/registry.py | 6 +- .../Run.py => psyneulink/globals/run.py | 14 ++-- .../globals/utilities.py | 10 +-- .../library}/__init__.py | 0 .../library/mechanisms}/__init__.py | 0 .../library/mechanisms/adaptive}/__init__.py | 0 .../mechanisms/adaptive/control}/__init__.py | 0 .../adaptive/control/lcmechanism.py | 20 +++--- .../autoassociativelearningmechanism.py | 36 +++++----- .../mechanisms/processing}/__init__.py | 0 .../processing/integrator}/__init__.py | 0 .../mechanisms/processing/integrator/ddm.py | 20 +++--- .../processing/objective}/__init__.py | 0 .../objective/comparatormechanism.py | 24 +++---- .../processing/transfer}/__init__.py | 0 .../mechanisms/processing/transfer/kwta.py | 14 ++-- .../mechanisms/processing/transfer/lca.py | 17 +++-- .../transfer/recurrenttransfermechanism.py | 30 ++++---- .../library/projections}/__init__.py | 0 .../library/projections/pathway}/__init__.py | 0 .../pathway/autoassociativeprojection.py | 20 +++--- .../library/subsystems}/__init__.py | 0 .../library/subsystems/agt}/__init__.py | 0 .../subsystems/agt/agtcontrolmechanism.py | 24 +++---- .../subsystems/agt/lccontrolmechanism.py | 24 +++---- .../library/subsystems/evc}/__init__.py | 0 .../library/subsystems/evc/evcauxiliary.py | 14 ++-- .../subsystems/evc/evccontrolmechanism.py | 38 +++++----- .../scheduling}/__init__.py | 0 .../scheduling/condition.py | 2 +- .../scheduling/scheduler.py | 4 +- .../scheduling/timescale.py | 2 +- setup.py | 2 +- tests/composition/test_composition.py | 49 ++++++------- tests/composition/test_graph.py | 2 +- tests/control/test_EVC.py | 20 +++--- tests/learning/test_multilayer.py | 16 ++--- tests/learning/test_reinforcement.py | 14 ++-- tests/learning/test_stroop.py | 14 ++-- tests/mechanisms/test_ddm_mechanism.py | 8 +-- tests/mechanisms/test_gating_mechanism.py | 18 ++--- tests/mechanisms/test_integrator_mechanism.py | 12 ++-- tests/mechanisms/test_kwta.py | 20 +++--- .../test_recurrent_transfer_mechanism.py | 20 +++--- tests/mechanisms/test_transfer_mechanism.py | 16 ++--- tests/no-learning/test_DDM.py | 8 +-- tests/no-learning/test_no-learning.py | 14 ++-- tests/scheduling/test_condition.py | 16 ++--- tests/scheduling/test_scheduler.py | 14 ++-- tests/scheduling/test_system_newsched.py | 22 +++--- tests/system/test_system.py | 18 ++--- tutorial/PsyNeuLink Tutorial.ipynb | 10 +-- 181 files changed, 1235 insertions(+), 1235 deletions(-) rename {PsyNeuLink => psyneulink}/__init__.py (73%) rename {PsyNeuLink/Components => psyneulink/components}/__init__.py (89%) rename PsyNeuLink/Components/Component.py => psyneulink/components/component.py (98%) rename {PsyNeuLink/Components/Functions => psyneulink/components/functions}/__init__.py (100%) rename PsyNeuLink/Components/Functions/Function.py => psyneulink/components/functions/function.py (99%) rename {PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/ControlMechanism => psyneulink/components/mechanisms}/__init__.py (100%) rename {PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/GatingMechanism => psyneulink/components/mechanisms/adaptive}/__init__.py (100%) rename PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/AdaptiveMechanism.py => psyneulink/components/mechanisms/adaptive/adaptivemechanism.py (96%) rename {PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/LearningMechanism => psyneulink/components/mechanisms/adaptive/control}/__init__.py (100%) rename PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/ControlMechanism/ControlMechanism.py => psyneulink/components/mechanisms/adaptive/control/controlmechanism.py (96%) rename PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/ControlMechanism/DefaultControlMechanism.py => psyneulink/components/mechanisms/adaptive/control/defaultcontrolmechanism.py (92%) rename {PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms => psyneulink/components/mechanisms/adaptive/gating}/__init__.py (100%) rename PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/GatingMechanism/GatingMechanism.py => psyneulink/components/mechanisms/adaptive/gating/gatingmechanism.py (96%) rename {PsyNeuLink/Components/Mechanisms/ProcessingMechanisms => psyneulink/components/mechanisms/adaptive/learning}/__init__.py (100%) rename PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/LearningMechanism/LearningAuxilliary.py => psyneulink/components/mechanisms/adaptive/learning/learningauxilliary.py (98%) rename PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/LearningMechanism/LearningMechanism.py => psyneulink/components/mechanisms/adaptive/learning/learningmechanism.py (97%) rename PsyNeuLink/Components/Mechanisms/Mechanism.py => psyneulink/components/mechanisms/mechanism.py (98%) rename {PsyNeuLink/Components/Mechanisms => psyneulink/components/mechanisms/processing}/__init__.py (100%) rename PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/CompositionInterfaceMechanism.py => psyneulink/components/mechanisms/processing/compositioninterfacemechanism.py (93%) rename PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/DefaultProcessingMechanism.py => psyneulink/components/mechanisms/processing/defaultprocessingmechanism.py (90%) rename PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/IntegratorMechanism.py => psyneulink/components/mechanisms/processing/integratormechanism.py (96%) rename PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/ObjectiveMechanism.py => psyneulink/components/mechanisms/processing/objectivemechanism.py (98%) rename PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/ProcessingMechanism.py => psyneulink/components/mechanisms/processing/processingmechanism.py (96%) rename PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/TransferMechanism.py => psyneulink/components/mechanisms/processing/transfermechanism.py (97%) rename PsyNeuLink/Components/Process.py => psyneulink/components/process.py (98%) rename {PsyNeuLink/Components/Projections/ModulatoryProjections => psyneulink/components/projections}/__init__.py (100%) rename {PsyNeuLink/Components/Projections/PathwayProjections => psyneulink/components/projections/modulatory}/__init__.py (100%) rename PsyNeuLink/Components/Projections/ModulatoryProjections/ControlProjection.py => psyneulink/components/projections/modulatory/controlprojection.py (95%) rename PsyNeuLink/Components/Projections/ModulatoryProjections/GatingProjection.py => psyneulink/components/projections/modulatory/gatingprojection.py (94%) rename PsyNeuLink/Components/Projections/ModulatoryProjections/LearningProjection.py => psyneulink/components/projections/modulatory/learningprojection.py (96%) rename PsyNeuLink/Components/Projections/ModulatoryProjections/ModulatoryProjection.py => psyneulink/components/projections/modulatory/modulatoryprojection.py (98%) rename {PsyNeuLink/Components/Projections => psyneulink/components/projections/pathway}/__init__.py (100%) rename PsyNeuLink/Components/Projections/PathwayProjections/MappingProjection.py => psyneulink/components/projections/pathway/mappingprojection.py (98%) rename PsyNeuLink/Components/Projections/PathwayProjections/PathwayProjection.py => psyneulink/components/projections/pathway/pathwayprojection.py (95%) rename PsyNeuLink/Components/Projections/Projection.py => psyneulink/components/projections/projection.py (98%) rename PsyNeuLink/Components/ShellClasses.py => psyneulink/components/shellclasses.py (99%) rename {PsyNeuLink/Components/States/ModulatorySignals => psyneulink/components/states}/__init__.py (100%) rename PsyNeuLink/Components/States/InputState.py => psyneulink/components/states/inputstate.py (98%) rename {PsyNeuLink/Components/States => psyneulink/components/states/modulatorysignals}/__init__.py (100%) rename PsyNeuLink/Components/States/ModulatorySignals/ControlSignal.py => psyneulink/components/states/modulatorysignals/controlsignal.py (98%) rename PsyNeuLink/Components/States/ModulatorySignals/GatingSignal.py => psyneulink/components/states/modulatorysignals/gatingsignal.py (97%) rename PsyNeuLink/Components/States/ModulatorySignals/LearningSignal.py => psyneulink/components/states/modulatorysignals/learningsignal.py (97%) rename PsyNeuLink/Components/States/ModulatorySignals/ModulatorySignal.py => psyneulink/components/states/modulatorysignals/modulatorysignal.py (97%) rename PsyNeuLink/Components/States/OutputState.py => psyneulink/components/states/outputstate.py (98%) rename PsyNeuLink/Components/States/ParameterState.py => psyneulink/components/states/parameterstate.py (97%) rename PsyNeuLink/Components/States/State.py => psyneulink/components/states/state.py (98%) rename PsyNeuLink/Components/System.py => psyneulink/components/system.py (98%) rename PsyNeuLink/Composition.py => psyneulink/composition.py (99%) rename {PsyNeuLink/Globals/Preferences => psyneulink/globals}/__init__.py (100%) rename PsyNeuLink/Globals/Defaults.py => psyneulink/globals/defaults.py (96%) rename PsyNeuLink/Globals/Keywords.py => psyneulink/globals/keywords.py (100%) rename PsyNeuLink/Globals/KVO.py => psyneulink/globals/kvo.py (100%) rename PsyNeuLink/Globals/Log.py => psyneulink/globals/log.py (99%) rename {PsyNeuLink/Globals => psyneulink/globals/preferences}/__init__.py (100%) rename PsyNeuLink/Globals/Preferences/ComponentPreferenceSet.py => psyneulink/globals/preferences/componentpreferenceset.py (98%) rename PsyNeuLink/Globals/Preferences/MechanismPreferenceSet.py => psyneulink/globals/preferences/mechanismpreferenceset.py (98%) rename PsyNeuLink/Globals/Preferences/PreferenceSet.py => psyneulink/globals/preferences/preferenceset.py (98%) rename PsyNeuLink/Globals/Registry.py => psyneulink/globals/registry.py (98%) rename PsyNeuLink/Globals/Run.py => psyneulink/globals/run.py (99%) rename PsyNeuLink/Globals/Utilities.py => psyneulink/globals/utilities.py (99%) rename {PsyNeuLink/Library/Mechanisms/AdaptiveMechanisms/ControlMechanisms => psyneulink/library}/__init__.py (100%) rename {PsyNeuLink/Library/Mechanisms/AdaptiveMechanisms => psyneulink/library/mechanisms}/__init__.py (100%) rename {PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/IntegratorMechanisms => psyneulink/library/mechanisms/adaptive}/__init__.py (100%) rename {PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/ObjectiveMechanisms => psyneulink/library/mechanisms/adaptive/control}/__init__.py (100%) rename PsyNeuLink/Library/Mechanisms/AdaptiveMechanisms/ControlMechanisms/LCMechanism.py => psyneulink/library/mechanisms/adaptive/control/lcmechanism.py (97%) rename PsyNeuLink/Library/Mechanisms/AdaptiveMechanisms/LearningMechanisms/AutoAssociativeLearningMechanism.py => psyneulink/library/mechanisms/adaptive/learning/autoassociativelearningmechanism.py (95%) rename {PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/TransferMechanisms => psyneulink/library/mechanisms/processing}/__init__.py (100%) rename {PsyNeuLink/Library/Mechanisms/ProcessingMechanisms => psyneulink/library/mechanisms/processing/integrator}/__init__.py (100%) rename PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/IntegratorMechanisms/DDM.py => psyneulink/library/mechanisms/processing/integrator/ddm.py (98%) rename {PsyNeuLink/Library/Mechanisms => psyneulink/library/mechanisms/processing/objective}/__init__.py (100%) rename PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/ObjectiveMechanisms/ComparatorMechanism.py => psyneulink/library/mechanisms/processing/objective/comparatormechanism.py (96%) rename {PsyNeuLink/Library/Projections/PathwayProjections => psyneulink/library/mechanisms/processing/transfer}/__init__.py (100%) rename PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/TransferMechanisms/KWTA.py => psyneulink/library/mechanisms/processing/transfer/kwta.py (98%) rename PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/TransferMechanisms/LCA.py => psyneulink/library/mechanisms/processing/transfer/lca.py (97%) rename PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/TransferMechanisms/RecurrentTransferMechanism.py => psyneulink/library/mechanisms/processing/transfer/recurrenttransfermechanism.py (97%) rename {PsyNeuLink/Library/Projections => psyneulink/library/projections}/__init__.py (100%) rename {PsyNeuLink/Library/Subsystems/AGT => psyneulink/library/projections/pathway}/__init__.py (100%) rename PsyNeuLink/Library/Projections/PathwayProjections/AutoAssociativeProjection.py => psyneulink/library/projections/pathway/autoassociativeprojection.py (97%) rename {PsyNeuLink/Library/Subsystems/EVC => psyneulink/library/subsystems}/__init__.py (100%) rename {PsyNeuLink/Library/Subsystems => psyneulink/library/subsystems/agt}/__init__.py (100%) rename PsyNeuLink/Library/Subsystems/AGT/AGTControlMechanism.py => psyneulink/library/subsystems/agt/agtcontrolmechanism.py (96%) rename PsyNeuLink/Library/Subsystems/AGT/LCControlMechanism.py => psyneulink/library/subsystems/agt/lccontrolmechanism.py (97%) rename {PsyNeuLink/Library => psyneulink/library/subsystems/evc}/__init__.py (100%) rename PsyNeuLink/Library/Subsystems/EVC/EVCAuxiliary.py => psyneulink/library/subsystems/evc/evcauxiliary.py (98%) rename PsyNeuLink/Library/Subsystems/EVC/EVCControlMechanism.py => psyneulink/library/subsystems/evc/evccontrolmechanism.py (97%) rename {PsyNeuLink/Scheduling => psyneulink/scheduling}/__init__.py (100%) rename PsyNeuLink/Scheduling/Condition.py => psyneulink/scheduling/condition.py (99%) rename PsyNeuLink/Scheduling/Scheduler.py => psyneulink/scheduling/scheduler.py (99%) rename PsyNeuLink/Scheduling/TimeScale.py => psyneulink/scheduling/timescale.py (98%) diff --git a/Scripts/DEBUGGING SCRIPTS/AGT Test Script.py b/Scripts/DEBUGGING SCRIPTS/AGT Test Script.py index 9fcd9dae887..17a12674fc8 100644 --- a/Scripts/DEBUGGING SCRIPTS/AGT Test Script.py +++ b/Scripts/DEBUGGING SCRIPTS/AGT Test Script.py @@ -1,9 +1,9 @@ -from PsyNeuLink.Components.Functions.Function import FHNIntegrator -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.System import system -from PsyNeuLink.Library.Subsystems.AGT.AGTControlMechanism import AGTControlMechanism -from PsyNeuLink.Library.Subsystems.AGT.LCControlMechanism import LCControlMechanism +from psyneulink.components.functions.function import FHNIntegrator +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.system import system +from psyneulink.library.subsystems.agt.agtcontrolmechanism import AGTControlMechanism +from psyneulink.library.subsystems.agt.lccontrolmechanism import LCControlMechanism decision_mech = TransferMechanism(name='Decision_Mech') diff --git a/Scripts/DEBUGGING SCRIPTS/EVC Gratton Script - SEBASTIAN.py b/Scripts/DEBUGGING SCRIPTS/EVC Gratton Script - SEBASTIAN.py index a24c3e7a029..a93ecd3cf14 100644 --- a/Scripts/DEBUGGING SCRIPTS/EVC Gratton Script - SEBASTIAN.py +++ b/Scripts/DEBUGGING SCRIPTS/EVC Gratton Script - SEBASTIAN.py @@ -1,11 +1,11 @@ # from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.Deprecated.LinearMechanism import * -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import * -from PsyNeuLink.Library.Mechanisms.AdaptiveMechanisms import EVCControlMechanism +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection +from psyneulink.components.system import system +from psyneulink.globals.keywords import * +from psyneulink.library.mechanisms.adaptive import EVCControlMechanism def test_search_function(controller=None, **kwargs): diff --git a/Scripts/DEBUGGING SCRIPTS/EVC System Laming Validation Test Script [SPECIFY ControlSignals]].py b/Scripts/DEBUGGING SCRIPTS/EVC System Laming Validation Test Script [SPECIFY ControlSignals]].py index 2178fe6479e..497ce2e3bea 100644 --- a/Scripts/DEBUGGING SCRIPTS/EVC System Laming Validation Test Script [SPECIFY ControlSignals]].py +++ b/Scripts/DEBUGGING SCRIPTS/EVC System Laming Validation Test Script [SPECIFY ControlSignals]].py @@ -1,11 +1,11 @@ # from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.Deprecated.LinearMechanism import * -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.States.ModulatorySignals.ControlSignal import ControlSignal -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import * -from PsyNeuLink.Library.Mechanisms.AdaptiveMechanisms import EVCControlMechanism +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import process +from psyneulink.components.states.modulatorysignals.controlsignal import ControlSignal +from psyneulink.components.system import system +from psyneulink.globals.keywords import * +from psyneulink.library.mechanisms.adaptive import EVCControlMechanism random.seed(0) np.random.seed(0) diff --git a/Scripts/DEBUGGING SCRIPTS/LCMechanism Test Script.py b/Scripts/DEBUGGING SCRIPTS/LCMechanism Test Script.py index 586ab701e91..e739961827e 100644 --- a/Scripts/DEBUGGING SCRIPTS/LCMechanism Test Script.py +++ b/Scripts/DEBUGGING SCRIPTS/LCMechanism Test Script.py @@ -1,8 +1,8 @@ -from PsyNeuLink.Components.Functions.Function import Linear, Logistic -from PsyNeuLink.Components.Functions.Function import ModulationParam -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.GatingMechanism.GatingMechanism import GatingMechanism -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Library.Subsystems.AGT.LCControlMechanism import LCControlMechanism +from psyneulink.components.functions.function import Linear, Logistic +from psyneulink.components.functions.function import ModulationParam +from psyneulink.components.mechanisms.adaptive.gating.gatingmechanism import GatingMechanism +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.library.subsystems.agt.lccontrolmechanism import LCControlMechanism my_mech_1 = TransferMechanism(function=Linear, name='my_linear_mechanism') diff --git a/Scripts/DEBUGGING SCRIPTS/Multilayer Learning Test Script [WITH GATING].py b/Scripts/DEBUGGING SCRIPTS/Multilayer Learning Test Script [WITH GATING].py index 2b4279ec2ed..7ed764ddece 100644 --- a/Scripts/DEBUGGING SCRIPTS/Multilayer Learning Test Script [WITH GATING].py +++ b/Scripts/DEBUGGING SCRIPTS/Multilayer Learning Test Script [WITH GATING].py @@ -1,11 +1,11 @@ -from PsyNeuLink.Components.Functions.Function import Logistic -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.GatingMechanism.GatingMechanism import GatingMechanism -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.States.ModulatorySignals.GatingSignal import GatingSignal -from PsyNeuLink.Components.States.OutputState import * -from PsyNeuLink.Components.System import system -from PsyNeuLink.Scheduling.Condition import AfterNCalls +from psyneulink.components.functions.function import Logistic +from psyneulink.components.mechanisms.adaptive.gating.gatingmechanism import GatingMechanism +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.states.modulatorysignals.gatingsignal import GatingSignal +from psyneulink.components.states.outputstate import * +from psyneulink.components.system import system +from psyneulink.scheduling.condition import AfterNCalls # from PsyNeuLink.Globals.Run import run, construct_inputs @@ -25,7 +25,7 @@ function=Logistic, default_variable = [0,0,0]) -from PsyNeuLink.Components.States.InputState import InputState +from psyneulink.components.states.inputstate import InputState my_input_state = InputState( # owner=Output_Layer, diff --git a/Scripts/DEBUGGING SCRIPTS/OLD/EVC Gratton Script_Bug1.py b/Scripts/DEBUGGING SCRIPTS/OLD/EVC Gratton Script_Bug1.py index f5fa0a04920..f13f0be6c3d 100644 --- a/Scripts/DEBUGGING SCRIPTS/OLD/EVC Gratton Script_Bug1.py +++ b/Scripts/DEBUGGING SCRIPTS/OLD/EVC Gratton Script_Bug1.py @@ -1,11 +1,11 @@ # from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.Deprecated.LinearMechanism import * -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import * -from PsyNeuLink.Library.Subsystems.EVC.EVCControlMechanism import EVCControlMechanism +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection +from psyneulink.components.system import system +from psyneulink.globals.keywords import * +from psyneulink.library.subsystems.evc.evccontrolmechanism import EVCControlMechanism def test_search_function(controller=None, **kwargs): diff --git a/Scripts/DEBUGGING SCRIPTS/OLD/EVC Gratton Script_Bug2.py b/Scripts/DEBUGGING SCRIPTS/OLD/EVC Gratton Script_Bug2.py index d2fa8f2e88f..31ebcaa7065 100644 --- a/Scripts/DEBUGGING SCRIPTS/OLD/EVC Gratton Script_Bug2.py +++ b/Scripts/DEBUGGING SCRIPTS/OLD/EVC Gratton Script_Bug2.py @@ -1,11 +1,11 @@ # from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.Deprecated.LinearMechanism import * -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import * -from PsyNeuLink.Library.Subsystems.EVC.EVCControlMechanism import EVCControlMechanism +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection +from psyneulink.components.system import system +from psyneulink.globals.keywords import * +from psyneulink.library.subsystems.evc.evccontrolmechanism import EVCControlMechanism def test_search_function(controller=None, **kwargs): diff --git a/Scripts/DEBUGGING SCRIPTS/OLD/EVC Gratton Script_Bug3.py b/Scripts/DEBUGGING SCRIPTS/OLD/EVC Gratton Script_Bug3.py index 455d7287f33..e7ae9d29375 100644 --- a/Scripts/DEBUGGING SCRIPTS/OLD/EVC Gratton Script_Bug3.py +++ b/Scripts/DEBUGGING SCRIPTS/OLD/EVC Gratton Script_Bug3.py @@ -1,11 +1,11 @@ # from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.Deprecated.LinearMechanism import * -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import * -from PsyNeuLink.Library.Mechanisms.AdaptiveMechanisms import EVCControlMechanism +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection +from psyneulink.components.system import system +from psyneulink.globals.keywords import * +from psyneulink.library.mechanisms.adaptive import EVCControlMechanism def test_search_function(controller=None, **kwargs): diff --git a/Scripts/DEBUGGING SCRIPTS/OLD/EVC Gratton Script_Bug4.py b/Scripts/DEBUGGING SCRIPTS/OLD/EVC Gratton Script_Bug4.py index 37a7bee7536..b9ab56c6143 100644 --- a/Scripts/DEBUGGING SCRIPTS/OLD/EVC Gratton Script_Bug4.py +++ b/Scripts/DEBUGGING SCRIPTS/OLD/EVC Gratton Script_Bug4.py @@ -1,11 +1,11 @@ # from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.Deprecated.LinearMechanism import * -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import * -from PsyNeuLink.Library.Mechanisms.AdaptiveMechanisms import EVCControlMechanism +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection +from psyneulink.components.system import system +from psyneulink.globals.keywords import * +from psyneulink.library.mechanisms.adaptive import EVCControlMechanism def test_search_function(controller=None, **kwargs): diff --git a/Scripts/DEBUGGING SCRIPTS/OLD/EVC Gratton Script_Bug5.py b/Scripts/DEBUGGING SCRIPTS/OLD/EVC Gratton Script_Bug5.py index f0d6f4008fb..3158704b30f 100644 --- a/Scripts/DEBUGGING SCRIPTS/OLD/EVC Gratton Script_Bug5.py +++ b/Scripts/DEBUGGING SCRIPTS/OLD/EVC Gratton Script_Bug5.py @@ -1,11 +1,11 @@ # from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.Deprecated.LinearMechanism import * -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import * -from PsyNeuLink.Library.Mechanisms.AdaptiveMechanisms import EVCControlMechanism +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection +from psyneulink.components.system import system +from psyneulink.globals.keywords import * +from psyneulink.library.mechanisms.adaptive import EVCControlMechanism def test_search_function(controller=None, **kwargs): diff --git a/Scripts/DEBUGGING SCRIPTS/OLD/EVC System Laming Validation Test Script DEBUGGING.py b/Scripts/DEBUGGING SCRIPTS/OLD/EVC System Laming Validation Test Script DEBUGGING.py index 83b24aa89e3..9897d5b7f64 100644 --- a/Scripts/DEBUGGING SCRIPTS/OLD/EVC System Laming Validation Test Script DEBUGGING.py +++ b/Scripts/DEBUGGING SCRIPTS/OLD/EVC System Laming Validation Test Script DEBUGGING.py @@ -1,11 +1,11 @@ # from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.Deprecated.LinearMechanism import * -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import * -from PsyNeuLink.Library.Mechanisms.AdaptiveMechanisms import EVCControlMechanism +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection +from psyneulink.components.system import system +from psyneulink.globals.keywords import * +from psyneulink.library.mechanisms.adaptive import EVCControlMechanism random.seed(0) np.random.seed(0) diff --git a/Scripts/DEBUGGING SCRIPTS/OLD/EVC System Laming Validation Test Script VARIATIONS.py b/Scripts/DEBUGGING SCRIPTS/OLD/EVC System Laming Validation Test Script VARIATIONS.py index 6e87aaf3ff8..45bffc453a6 100644 --- a/Scripts/DEBUGGING SCRIPTS/OLD/EVC System Laming Validation Test Script VARIATIONS.py +++ b/Scripts/DEBUGGING SCRIPTS/OLD/EVC System Laming Validation Test Script VARIATIONS.py @@ -1,11 +1,11 @@ # from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.Deprecated.LinearMechanism import * -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.ControlMechanism.EVCControlMechanism import EVCControlMechanism +from psyneulink.components.mechanisms.adaptive.control.EVCControlMechanism import EVCControlMechanism -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import * +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection +from psyneulink.components.system import system +from psyneulink.globals.keywords import * # import random # random.seed(0) diff --git a/Scripts/DEBUGGING SCRIPTS/OLD/EVC_Gratton_Script_Validation.py b/Scripts/DEBUGGING SCRIPTS/OLD/EVC_Gratton_Script_Validation.py index c7cf3e93cce..a9b1cfed9e4 100644 --- a/Scripts/DEBUGGING SCRIPTS/OLD/EVC_Gratton_Script_Validation.py +++ b/Scripts/DEBUGGING SCRIPTS/OLD/EVC_Gratton_Script_Validation.py @@ -1,11 +1,11 @@ # from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.Deprecated.LinearMechanism import * -from PsyNeuLink.Components.Projections.ControlProjection import ControlProjection +from psyneulink.components.projections.ControlProjection import ControlProjection -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import * -from PsyNeuLink.Library.Mechanisms.AdaptiveMechanisms import EVCControlMechanism +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import process +from psyneulink.components.system import system +from psyneulink.globals.keywords import * +from psyneulink.library.mechanisms.adaptive import EVCControlMechanism def test_search_function(controller=None, **kwargs): diff --git a/Scripts/DEBUGGING SCRIPTS/OLD/Multilayer Learning Test Script VARIATIONS.py b/Scripts/DEBUGGING SCRIPTS/OLD/Multilayer Learning Test Script VARIATIONS.py index 20e2ca7fdf1..aa6a5f61d0e 100644 --- a/Scripts/DEBUGGING SCRIPTS/OLD/Multilayer Learning Test Script VARIATIONS.py +++ b/Scripts/DEBUGGING SCRIPTS/OLD/Multilayer Learning Test Script VARIATIONS.py @@ -1,10 +1,10 @@ # from PsyNeuLink.Components.Functions.Function import Logistic, random_matrix -from PsyNeuLink.Components.Functions.Function import Logistic -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Scheduling.TimeScale import TimeScale +from psyneulink.components.functions.function import Logistic +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.system import system +from psyneulink.scheduling.timescale import TimeScale Input_Layer = TransferMechanism(name='Input Layer', function=Logistic, diff --git a/Scripts/DEBUGGING SCRIPTS/OLD/Scripts_DEBUGGING_SCRIPTS_EVC_Gratton_Script_-_SEBASTIAN_py.py b/Scripts/DEBUGGING SCRIPTS/OLD/Scripts_DEBUGGING_SCRIPTS_EVC_Gratton_Script_-_SEBASTIAN_py.py index 970eaf4774b..3e778c811a3 100644 --- a/Scripts/DEBUGGING SCRIPTS/OLD/Scripts_DEBUGGING_SCRIPTS_EVC_Gratton_Script_-_SEBASTIAN_py.py +++ b/Scripts/DEBUGGING SCRIPTS/OLD/Scripts_DEBUGGING_SCRIPTS_EVC_Gratton_Script_-_SEBASTIAN_py.py @@ -1,11 +1,11 @@ # from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.Deprecated.LinearMechanism import * -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import * -from PsyNeuLink.Library.Subsystems.EVC.EVCControlMechanism import EVCControlMechanism +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection +from psyneulink.components.system import system +from psyneulink.globals.keywords import * +from psyneulink.library.subsystems.evc.evccontrolmechanism import EVCControlMechanism def test_search_function(controller=None, **kwargs): diff --git a/Scripts/DEBUGGING SCRIPTS/OLD/Sebastian's Multitasking Model.py b/Scripts/DEBUGGING SCRIPTS/OLD/Sebastian's Multitasking Model.py index a02d807aa62..9b563ec8594 100644 --- a/Scripts/DEBUGGING SCRIPTS/OLD/Sebastian's Multitasking Model.py +++ b/Scripts/DEBUGGING SCRIPTS/OLD/Sebastian's Multitasking Model.py @@ -1,8 +1,8 @@ # from PsyNeuLink.Components.Functions.Function import Logistic, random_matrix -from PsyNeuLink.Components.Functions.Function import Logistic -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.System import * +from psyneulink.components.functions.function import Logistic +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.system import * # specification of task environment NFeatures = 2 diff --git a/Scripts/DEBUGGING SCRIPTS/OLD/Stroop Model Learning Test Script - EQUAL.py b/Scripts/DEBUGGING SCRIPTS/OLD/Stroop Model Learning Test Script - EQUAL.py index e4e5e047505..395eba0b11f 100644 --- a/Scripts/DEBUGGING SCRIPTS/OLD/Stroop Model Learning Test Script - EQUAL.py +++ b/Scripts/DEBUGGING SCRIPTS/OLD/Stroop Model Learning Test Script - EQUAL.py @@ -1,8 +1,8 @@ -from PsyNeuLink.Components.Functions.Function import Linear, Logistic -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.System import * -from PsyNeuLink.Globals.Keywords import * +from psyneulink.components.functions.function import Linear, Logistic +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.system import * +from psyneulink.globals.keywords import * process_prefs = {REPORT_OUTPUT_PREF: True, VERBOSE_PREF: False} diff --git a/Scripts/DEBUGGING SCRIPTS/OLD/Stroop Model Learning and Control Test Script.py b/Scripts/DEBUGGING SCRIPTS/OLD/Stroop Model Learning and Control Test Script.py index 9db00fbe710..6eff71b3738 100644 --- a/Scripts/DEBUGGING SCRIPTS/OLD/Stroop Model Learning and Control Test Script.py +++ b/Scripts/DEBUGGING SCRIPTS/OLD/Stroop Model Learning and Control Test Script.py @@ -1,9 +1,9 @@ -from PsyNeuLink.Components.Functions.Function import Linear, Logistic -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.System import * -from PsyNeuLink.Globals.Keywords import * -from PsyNeuLink.Library.Subsystems.EVC.EVCControlMechanism import EVCControlMechanism +from psyneulink.components.functions.function import Linear, Logistic +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.system import * +from psyneulink.globals.keywords import * +from psyneulink.library.subsystems.evc.evccontrolmechanism import EVCControlMechanism process_prefs = {REPORT_OUTPUT_PREF: True, VERBOSE_PREF: False} diff --git a/Scripts/DEBUGGING SCRIPTS/OLD/Stroop Model Test Script VARIATIONS.py b/Scripts/DEBUGGING SCRIPTS/OLD/Stroop Model Test Script VARIATIONS.py index d997944d3b0..54fe9e8776f 100644 --- a/Scripts/DEBUGGING SCRIPTS/OLD/Stroop Model Test Script VARIATIONS.py +++ b/Scripts/DEBUGGING SCRIPTS/OLD/Stroop Model Test Script VARIATIONS.py @@ -1,7 +1,7 @@ -from PsyNeuLink.Components.Functions.Function import Linear, Logistic -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.System import * -from PsyNeuLink.Globals.Keywords import * +from psyneulink.components.functions.function import Linear, Logistic +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.system import * +from psyneulink.globals.keywords import * process_prefs = {REPORT_OUTPUT_PREF: True, VERBOSE_PREF: False} diff --git a/Scripts/DEBUGGING SCRIPTS/OLD/StroopEVCforDST.py b/Scripts/DEBUGGING SCRIPTS/OLD/StroopEVCforDST.py index cd9769e28c2..4a8e2cde411 100644 --- a/Scripts/DEBUGGING SCRIPTS/OLD/StroopEVCforDST.py +++ b/Scripts/DEBUGGING SCRIPTS/OLD/StroopEVCforDST.py @@ -5,10 +5,10 @@ @author: lauraab """ -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection -from PsyNeuLink.Components.System import * -from PsyNeuLink.Library.Subsystems.EVC.EVCControlMechanism import EVCControlMechanism +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection +from psyneulink.components.system import * +from psyneulink.library.subsystems.evc.evccontrolmechanism import EVCControlMechanism #helpful commands! .show() .excute() color_word_combine = TransferMechanism(name='color_word_combine', function = Linear()) #default_variable = [1], #JON HOW TO MAKE THIS A SUBTRACTION? diff --git a/Scripts/DEBUGGING SCRIPTS/OLD/Stroop_model_markus.py b/Scripts/DEBUGGING SCRIPTS/OLD/Stroop_model_markus.py index 9630bf70d9f..021c66af38d 100644 --- a/Scripts/DEBUGGING SCRIPTS/OLD/Stroop_model_markus.py +++ b/Scripts/DEBUGGING SCRIPTS/OLD/Stroop_model_markus.py @@ -1,8 +1,8 @@ # from PsyNeuLink.Components.Functions.Function import Logistic, random_matrix -from PsyNeuLink.Components.Functions.Function import Logistic -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.System import * +from psyneulink.components.functions.function import Logistic +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.system import * # specification of task environment NFeatures = 1 diff --git a/Scripts/DEBUGGING SCRIPTS/assign_inputs_to_composition.py b/Scripts/DEBUGGING SCRIPTS/assign_inputs_to_composition.py index b1eb98dc9b5..b86523faa4f 100644 --- a/Scripts/DEBUGGING SCRIPTS/assign_inputs_to_composition.py +++ b/Scripts/DEBUGGING SCRIPTS/assign_inputs_to_composition.py @@ -1,9 +1,9 @@ -from PsyNeuLink.Components.Functions.Function import Linear -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Composition import Composition -from PsyNeuLink.Scheduling.Scheduler import Scheduler +from psyneulink.components.functions.function import Linear +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.composition import Composition +from psyneulink.scheduling.scheduler import Scheduler comp = Composition() A = TransferMechanism(default_variable=1.0, function=Linear(slope=5.0)) diff --git a/Scripts/DEMO SCRIPTS/DDM_scheduled_simple.py b/Scripts/DEMO SCRIPTS/DDM_scheduled_simple.py index 4fcd1aa5624..f1c05ae6dc8 100644 --- a/Scripts/DEMO SCRIPTS/DDM_scheduled_simple.py +++ b/Scripts/DEMO SCRIPTS/DDM_scheduled_simple.py @@ -1,11 +1,11 @@ -from PsyNeuLink.Components.Functions.Function import Integrator, Linear -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.System import * -from PsyNeuLink.Globals.Keywords import DIFFUSION -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.IntegratorMechanisms import DDM -from PsyNeuLink.Scheduling.Condition import AfterNCalls, AtPass, WhenFinished -from PsyNeuLink.Scheduling.Scheduler import Scheduler -from PsyNeuLink.Scheduling.TimeScale import TimeScale +from psyneulink.components.functions.function import Integrator, Linear +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.system import * +from psyneulink.globals.keywords import DIFFUSION +from psyneulink.library.mechanisms.processing.integrator.ddm import DDM +from psyneulink.scheduling.condition import AfterNCalls, AtPass, WhenFinished +from psyneulink.scheduling.scheduler import Scheduler +from psyneulink.scheduling.timescale import TimeScale logger = logging.getLogger(__name__) diff --git a/Scripts/DEMO SCRIPTS/DDM_scheduled_simple_limited_calls.py b/Scripts/DEMO SCRIPTS/DDM_scheduled_simple_limited_calls.py index 83706fb189d..2f735372f83 100644 --- a/Scripts/DEMO SCRIPTS/DDM_scheduled_simple_limited_calls.py +++ b/Scripts/DEMO SCRIPTS/DDM_scheduled_simple_limited_calls.py @@ -1,11 +1,11 @@ -from PsyNeuLink.Components.Functions.Function import Integrator, Linear -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.System import * -from PsyNeuLink.Globals.Keywords import DIFFUSION -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.IntegratorMechanisms import DDM -from PsyNeuLink.Scheduling.Condition import AfterNCalls, Any, AtPass, WhenFinished -from PsyNeuLink.Scheduling.Scheduler import Scheduler -from PsyNeuLink.Scheduling.TimeScale import TimeScale +from psyneulink.components.functions.function import Integrator, Linear +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.system import * +from psyneulink.globals.keywords import DIFFUSION +from psyneulink.library.mechanisms.processing.integrator.ddm import DDM +from psyneulink.scheduling.condition import AfterNCalls, Any, AtPass, WhenFinished +from psyneulink.scheduling.scheduler import Scheduler +from psyneulink.scheduling.timescale import TimeScale logger = logging.getLogger(__name__) diff --git a/Scripts/DEMO SCRIPTS/EVC System DEMO Script.py b/Scripts/DEMO SCRIPTS/EVC System DEMO Script.py index fc9d7315642..9f67f541fda 100644 --- a/Scripts/DEMO SCRIPTS/EVC System DEMO Script.py +++ b/Scripts/DEMO SCRIPTS/EVC System DEMO Script.py @@ -2,12 +2,12 @@ import random -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import * -from PsyNeuLink.Library.Subsystems.EVC import EVCControlMechanism +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection +from psyneulink.components.system import system +from psyneulink.globals.keywords import * +from psyneulink.library.subsystems.evc import evccontrolmechanism random.seed(0) np.random.seed(0) @@ -60,7 +60,7 @@ # System: mySystem = system(processes=[TaskExecutionProcess, RewardProcess], - controller=EVCControlMechanism, + controller=evccontrolmechanism, enable_controller=True, monitor_for_control=[Reward, DDM_PROBABILITY_UPPER_THRESHOLD, (DDM_RESPONSE_TIME, -1, 1)], name='EVC Test System') diff --git a/Scripts/DEMO SCRIPTS/Integrator_scheduled_timescales.py b/Scripts/DEMO SCRIPTS/Integrator_scheduled_timescales.py index 162487c8983..ed08314de29 100644 --- a/Scripts/DEMO SCRIPTS/Integrator_scheduled_timescales.py +++ b/Scripts/DEMO SCRIPTS/Integrator_scheduled_timescales.py @@ -1,9 +1,9 @@ -from PsyNeuLink.Components.Functions.Function import Integrator, Linear -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms import IntegratorMechanism -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.System import * -from PsyNeuLink.Scheduling.Condition import AfterNCalls, Any, AtPass, EveryNCalls -from PsyNeuLink.Scheduling.Scheduler import Scheduler +from psyneulink.components.functions.function import Integrator, Linear +from psyneulink.components.mechanisms.processing import integratormechanism +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.system import * +from psyneulink.scheduling.condition import AfterNCalls, Any, AtPass, EveryNCalls +from psyneulink.scheduling.scheduler import Scheduler logger = logging.getLogger(__name__) @@ -19,7 +19,7 @@ prefs={REPORT_OUTPUT_PREF: PreferenceEntry(False,PreferenceLevel.INSTANCE)} ) -B = IntegratorMechanism( +B = integratormechanism( name='B', default_variable = [0], function=Integrator( @@ -29,7 +29,7 @@ prefs={REPORT_OUTPUT_PREF: PreferenceEntry(False,PreferenceLevel.INSTANCE)} ) -C = IntegratorMechanism( +C = integratormechanism( name='C', default_variable = [0], function=Integrator( diff --git a/Scripts/DEMO SCRIPTS/Mixed NN & DDM DEMO Script.py b/Scripts/DEMO SCRIPTS/Mixed NN & DDM DEMO Script.py index cf27ef6ec8a..824cd994b52 100644 --- a/Scripts/DEMO SCRIPTS/Mixed NN & DDM DEMO Script.py +++ b/Scripts/DEMO SCRIPTS/Mixed NN & DDM DEMO Script.py @@ -1,6 +1,6 @@ -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.System import system +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import process +from psyneulink.components.system import system myInputLayer = TransferMechanism(name='Input Layer', function=Linear(), diff --git a/Scripts/DEMO SCRIPTS/Multilayer Learning Test Script DEMO.py b/Scripts/DEMO SCRIPTS/Multilayer Learning Test Script DEMO.py index 5b727db4e0e..b4250f0e4cd 100644 --- a/Scripts/DEMO SCRIPTS/Multilayer Learning Test Script DEMO.py +++ b/Scripts/DEMO SCRIPTS/Multilayer Learning Test Script DEMO.py @@ -1,10 +1,10 @@ import matplotlib -from PsyNeuLink.Components.Functions.Function import Logistic -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.System import system +from psyneulink.components.functions.function import Logistic +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.system import system matplotlib.use('TkAgg') diff --git a/Scripts/DEMO SCRIPTS/NEW_Learning_Markus.py b/Scripts/DEMO SCRIPTS/NEW_Learning_Markus.py index 70b06946e24..87adda4909a 100644 --- a/Scripts/DEMO SCRIPTS/NEW_Learning_Markus.py +++ b/Scripts/DEMO SCRIPTS/NEW_Learning_Markus.py @@ -1,9 +1,9 @@ #from PsyNeuLink.Components.Functions.Function import Logistic , random_matrix # from PsyNeuLink.Components.Functions.Function import Logistic , random_matrix -from PsyNeuLink.Components.Functions.Function import Logistic, Linear -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.System import * +from psyneulink.components.functions.function import Logistic, Linear +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.system import * # specification of task environment NFeatures = 1 diff --git a/Scripts/DEMO SCRIPTS/Stroop Demo Script with Learning.py b/Scripts/DEMO SCRIPTS/Stroop Demo Script with Learning.py index e252c898d6e..dc0f4df9bdc 100644 --- a/Scripts/DEMO SCRIPTS/Stroop Demo Script with Learning.py +++ b/Scripts/DEMO SCRIPTS/Stroop Demo Script with Learning.py @@ -1,10 +1,10 @@ # from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.Deprecated.LinearMechanism import * -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import * -from PsyNeuLink.Library.Mechanisms.AdaptiveMechanisms import EVCControlMechanism +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import process +from psyneulink.components.system import system +from psyneulink.globals.keywords import * +from psyneulink.library.mechanisms.adaptive import EVCControlMechanism # Stimulus Mechanisms Color_Input = TransferMechanism(name='Color Input', function=Linear(slope = 0.2995)) diff --git a/Scripts/DEMO SCRIPTS/Stroop Demo Script.py b/Scripts/DEMO SCRIPTS/Stroop Demo Script.py index 2cf9f4e0c01..ea2931bee6f 100644 --- a/Scripts/DEMO SCRIPTS/Stroop Demo Script.py +++ b/Scripts/DEMO SCRIPTS/Stroop Demo Script.py @@ -1,10 +1,10 @@ # from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.Deprecated.LinearMechanism import * -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Library.Mechanisms.AdaptiveMechanisms import EVCControlMechanism +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection +from psyneulink.components.system import system +from psyneulink.library.mechanisms.adaptive import EVCControlMechanism # Stimulus Mechanisms Color_Input = TransferMechanism(name='Color Input', function=Linear(slope = 0.2995)) diff --git a/Scripts/DEMO SCRIPTS/Xor_Script_2_processes.py b/Scripts/DEMO SCRIPTS/Xor_Script_2_processes.py index a6ca80df189..2a20de75c13 100644 --- a/Scripts/DEMO SCRIPTS/Xor_Script_2_processes.py +++ b/Scripts/DEMO SCRIPTS/Xor_Script_2_processes.py @@ -3,10 +3,10 @@ # In[ ]: -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.System import system +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.system import system #The following code starts to build a 3 layer neural network diff --git a/Scripts/DEMO SCRIPTS/Xor_Script_NotYetWorking.py b/Scripts/DEMO SCRIPTS/Xor_Script_NotYetWorking.py index 53d156ba9aa..01e5cd792e2 100644 --- a/Scripts/DEMO SCRIPTS/Xor_Script_NotYetWorking.py +++ b/Scripts/DEMO SCRIPTS/Xor_Script_NotYetWorking.py @@ -3,10 +3,10 @@ # In[ ]: -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.System import system +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.system import system #The following code starts to build a 3 layer neural network diff --git a/Scripts/DEMO SCRIPTS/Xor_Script_Working.py b/Scripts/DEMO SCRIPTS/Xor_Script_Working.py index 2085a7aaf1c..e642dd5a82c 100644 --- a/Scripts/DEMO SCRIPTS/Xor_Script_Working.py +++ b/Scripts/DEMO SCRIPTS/Xor_Script_Working.py @@ -3,10 +3,10 @@ # In[ ]: -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.System import system +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.system import system #The following code starts to build a 3 layer neural network diff --git a/Scripts/DEMO SCRIPTS/documentation_examples.py b/Scripts/DEMO SCRIPTS/documentation_examples.py index ba948114de7..ad0f50c4206 100644 --- a/Scripts/DEMO SCRIPTS/documentation_examples.py +++ b/Scripts/DEMO SCRIPTS/documentation_examples.py @@ -1,34 +1,34 @@ import numpy as np -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms \ - .IntegratorMechanism import \ +from psyneulink.components.mechanisms.processing \ + .integratormechanism import \ IntegratorMechanism -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms \ +from psyneulink.components.mechanisms.processing \ .RecurrentTransferMechanism import \ RecurrentTransferMechanism -from PsyNeuLink.Scheduling.condition import EveryNCalls, Any, AfterNCalls, EveryNPasses +from psyneulink.scheduling.condition import EveryNCalls, Any, AfterNCalls, EveryNPasses -from PsyNeuLink import ModulationParam -from PsyNeuLink.Components.Functions.Function import AdaptiveIntegrator, \ +from psyneulink import ModulationParam +from psyneulink.components.functions.function import AdaptiveIntegrator, \ BogaczEtAl, DriftDiffusionIntegrator, Linear, Logistic, PROB, SoftMax -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.GatingMechanism \ - .GatingMechanism import \ +from psyneulink.components.mechanisms.adaptive.gating \ + .gatingmechanism import \ GatingMechanism -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ObjectiveMechanism import \ +from psyneulink.components.mechanisms.processing.objectivemechanism import \ ComparatorMechanism -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism \ +from psyneulink.components.mechanisms.processing.transfermechanism \ import \ MEAN, RESULT, TransferMechanism, VARIANCE, TRANSFER_OUTPUT -from PsyNeuLink.Components.Process import PARAMETER_STATE_PARAMS, \ +from psyneulink.components.process import PARAMETER_STATE_PARAMS, \ RANDOM_CONNECTIVITY_MATRIX, process -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection \ +from psyneulink.components.projections.pathway.mappingprojection \ import MappingProjection -from PsyNeuLink.Components.States.ModulatorySignals import ControlSignal -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import ENABLED, GAIN, NAME, INDEX, CALCULATE, \ +from psyneulink.components.states.modulatorysignals import controlsignal +from psyneulink.components.system import system +from psyneulink.globals.keywords import ENABLED, GAIN, NAME, INDEX, CALCULATE, \ INTERCEPT, MECHANISM, MODULATION, GATE -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.IntegratorMechanisms.DDM import DDM, \ +from psyneulink.library.mechanisms.processing.integrator.ddm import DDM, \ NOISE, THRESHOLD, TimeScale -from PsyNeuLink.Scheduling.Scheduler import Scheduler +from psyneulink.scheduling.scheduler import Scheduler def intro(): @@ -205,7 +205,7 @@ def states(): function=Logistic( gain=0.5, bias=(1.0, - ControlSignal.ControlSignal( + controlsignal.ControlSignal( modulation=ModulationParam.ADDITIVE)))) # my_mapping_projection = MappingProjection(sender=my_input_mechanism, @@ -251,11 +251,11 @@ def states(): # endregion # region ControlSignals - my_mech = TransferMechanism(function=Logistic(bias=(1.0, ControlSignal))) + my_mech = TransferMechanism(function=Logistic(bias=(1.0, controlsignal))) # need clarification on Modulate the parameter of a Mechanism’s function my_mech = TransferMechanism(function=Logistic(gain=( - 1.0, ControlSignal.ControlSignal(modulation=ModulationParam.ADDITIVE)))) + 1.0, controlsignal.ControlSignal(modulation=ModulationParam.ADDITIVE)))) my_mech_A = TransferMechanism(function=Logistic) my_mech_B = TransferMechanism(function=Linear, output_states=[RESULT, MEAN]) diff --git a/Scripts/DEMO SCRIPTS/mechanism-function-plots.py b/Scripts/DEMO SCRIPTS/mechanism-function-plots.py index 93b58579cdc..546388fb82c 100644 --- a/Scripts/DEMO SCRIPTS/mechanism-function-plots.py +++ b/Scripts/DEMO SCRIPTS/mechanism-function-plots.py @@ -1,6 +1,6 @@ import matplotlib -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * +from psyneulink.components.mechanisms.processing.transfermechanism import * matplotlib.use('TkAgg') # LINEAR diff --git a/Scripts/DEMO SCRIPTS/noise-plots-dynamic.py b/Scripts/DEMO SCRIPTS/noise-plots-dynamic.py index 165d123cfc3..1ffd659ff70 100644 --- a/Scripts/DEMO SCRIPTS/noise-plots-dynamic.py +++ b/Scripts/DEMO SCRIPTS/noise-plots-dynamic.py @@ -1,6 +1,6 @@ from matplotlib import pyplot as plt -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * +from psyneulink.components.mechanisms.processing.transfermechanism import * threshold = 10 diff --git a/Scripts/MISCELLANEOUS SCRIPTS/ComparatorTestScript.py b/Scripts/MISCELLANEOUS SCRIPTS/ComparatorTestScript.py index 0dbba59060f..a2a509dc4b0 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/ComparatorTestScript.py +++ b/Scripts/MISCELLANEOUS SCRIPTS/ComparatorTestScript.py @@ -1,7 +1,7 @@ -from PsyNeuLink.Components.Process import Process_Base -from PsyNeuLink.Globals.Keywords import * +from psyneulink.components.process import Process_Base +from psyneulink.globals.keywords import * # from Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism # sample_mech = TransferMechanism(name='Sample', diff --git a/Scripts/MISCELLANEOUS SCRIPTS/DDM Learning Test Script.py b/Scripts/MISCELLANEOUS SCRIPTS/DDM Learning Test Script.py index ef6a448ae40..305082297d4 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/DDM Learning Test Script.py +++ b/Scripts/MISCELLANEOUS SCRIPTS/DDM Learning Test Script.py @@ -1,7 +1,7 @@ -from PsyNeuLink.Components.Functions.Function import Logistic -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection +from psyneulink.components.functions.function import Logistic +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection Input_Layer = TransferMechanism(name='Input Layer', function=Logistic(), diff --git a/Scripts/MISCELLANEOUS SCRIPTS/DDM Test Script (simple).py b/Scripts/MISCELLANEOUS SCRIPTS/DDM Test Script (simple).py index 03b6a6e4d7a..51788484729 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/DDM Test Script (simple).py +++ b/Scripts/MISCELLANEOUS SCRIPTS/DDM Test Script (simple).py @@ -1,4 +1,4 @@ -from PsyNeuLink.Components.Process import * +from psyneulink.components.process import * # myMechanism = DDM(function=NavarroAndFuss(drift_rate=1.0, # threshold=10.0, diff --git a/Scripts/MISCELLANEOUS SCRIPTS/EVC System Laming Validation Test Script COPY.py b/Scripts/MISCELLANEOUS SCRIPTS/EVC System Laming Validation Test Script COPY.py index c70d4eac28e..68c8d0bc37c 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/EVC System Laming Validation Test Script COPY.py +++ b/Scripts/MISCELLANEOUS SCRIPTS/EVC System Laming Validation Test Script COPY.py @@ -1,10 +1,10 @@ # from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.Deprecated.LinearMechanism import * -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import * -from PsyNeuLink.Library.Mechanisms.AdaptiveMechanisms import EVCControlMechanism +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection +from psyneulink.components.system import system +from psyneulink.globals.keywords import * +from psyneulink.library.mechanisms.adaptive import EVCControlMechanism # Preferences: DDM_prefs = ComponentPreferenceSet( diff --git a/Scripts/MISCELLANEOUS SCRIPTS/EVC System Laming Validation Test Script with Custom Fn.py b/Scripts/MISCELLANEOUS SCRIPTS/EVC System Laming Validation Test Script with Custom Fn.py index 849904751f8..cfb550b043b 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/EVC System Laming Validation Test Script with Custom Fn.py +++ b/Scripts/MISCELLANEOUS SCRIPTS/EVC System Laming Validation Test Script with Custom Fn.py @@ -1,10 +1,10 @@ # from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.Deprecated.LinearMechanism import * -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import * -from PsyNeuLink.Library.Subsystems.EVC.EVCControlMechanism import EVCControlMechanism +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection +from psyneulink.components.system import system +from psyneulink.globals.keywords import * +from psyneulink.library.subsystems.evc.evccontrolmechanism import EVCControlMechanism # import random diff --git a/Scripts/MISCELLANEOUS SCRIPTS/EVC System Test Script (with MPI).py b/Scripts/MISCELLANEOUS SCRIPTS/EVC System Test Script (with MPI).py index 8a308073bd5..0ff48589483 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/EVC System Test Script (with MPI).py +++ b/Scripts/MISCELLANEOUS SCRIPTS/EVC System Test Script (with MPI).py @@ -1,10 +1,10 @@ -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.Deprecated.LinearMechanism import * +from psyneulink.components.mechanisms.processing.Deprecated.LinearMechanism import * -from PsyNeuLink.Components.Functions.Function import Exponential, Linear -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection -from PsyNeuLink.Components.System import System_Base -from PsyNeuLink.Globals.Keywords import * +from psyneulink.components.functions.function import Exponential, Linear +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection +from psyneulink.components.system import System_Base +from psyneulink.globals.keywords import * if MPI_IMPLEMENTATION: import time diff --git a/Scripts/MISCELLANEOUS SCRIPTS/EVC System Test Script with Profiler.py b/Scripts/MISCELLANEOUS SCRIPTS/EVC System Test Script with Profiler.py index fde963879d2..114c6030fe1 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/EVC System Test Script with Profiler.py +++ b/Scripts/MISCELLANEOUS SCRIPTS/EVC System Test Script with Profiler.py @@ -1,11 +1,11 @@ import profile -from PsyNeuLink.Components.Mechanisms.IntegratorMechanism import * -from PsyNeuLink.Components.Mechanisms.LinearMechanism import * +from psyneulink.components.mechanisms.IntegratorMechanism import * +from psyneulink.components.mechanisms.LinearMechanism import * -from PsyNeuLink.Components.Process import Process_Base -from PsyNeuLink.Components.System import System_Base -from PsyNeuLink.Globals.Keywords import * +from psyneulink.components.process import Process_Base +from psyneulink.components.system import System_Base +from psyneulink.globals.keywords import * def run(): diff --git a/Scripts/MISCELLANEOUS SCRIPTS/Integrator-test-script.py b/Scripts/MISCELLANEOUS SCRIPTS/Integrator-test-script.py index e7c2bd77910..f8b95d528cb 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/Integrator-test-script.py +++ b/Scripts/MISCELLANEOUS SCRIPTS/Integrator-test-script.py @@ -1,5 +1,5 @@ -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Globals.Keywords import * +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.globals.keywords import * run_DDM_tests = True run_transfer_tests = True diff --git a/Scripts/MISCELLANEOUS SCRIPTS/Learning Signal Test Script.py b/Scripts/MISCELLANEOUS SCRIPTS/Learning Signal Test Script.py index c8db84d9231..9fc0c3bf1a9 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/Learning Signal Test Script.py +++ b/Scripts/MISCELLANEOUS SCRIPTS/Learning Signal Test Script.py @@ -1,8 +1,8 @@ # from PsyNeuLink.Components.Functions.Function import Logistic, random_matrix -from PsyNeuLink.Components.Functions.Function import Logistic -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection +from psyneulink.components.functions.function import Logistic +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection random_weight_matrix = lambda sender, receiver : random_matrix(sender, receiver, .2, -.1) diff --git a/Scripts/MISCELLANEOUS SCRIPTS/Multilayer Learning Test Script (CLEAN).py b/Scripts/MISCELLANEOUS SCRIPTS/Multilayer Learning Test Script (CLEAN).py index 8b26b8cebce..bad38ed2d76 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/Multilayer Learning Test Script (CLEAN).py +++ b/Scripts/MISCELLANEOUS SCRIPTS/Multilayer Learning Test Script (CLEAN).py @@ -1,8 +1,8 @@ -from PsyNeuLink.Components.Functions.Function import Logistic -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection +from psyneulink.components.functions.function import Logistic +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.learningprojection import LearningProjection +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection Input_Layer = TransferMechanism(name='Input Layer', function=Logistic(), diff --git a/Scripts/MISCELLANEOUS SCRIPTS/Process Initialization Test Script.py b/Scripts/MISCELLANEOUS SCRIPTS/Process Initialization Test Script.py index 296072bc622..9f4e54b27d6 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/Process Initialization Test Script.py +++ b/Scripts/MISCELLANEOUS SCRIPTS/Process Initialization Test Script.py @@ -1,7 +1,7 @@ -from PsyNeuLink.Components.Function import Linear +from psyneulink.components.Function import Linear -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import * +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import * linear_transfer_mechanism = TransferMechanism(function=Linear(slope = 1, intercept = 0)) diff --git a/Scripts/MISCELLANEOUS SCRIPTS/Reinforcement Learning Test Script [SIMPLE].py b/Scripts/MISCELLANEOUS SCRIPTS/Reinforcement Learning Test Script [SIMPLE].py index 1d2666efaec..fcc8e6d8ab5 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/Reinforcement Learning Test Script [SIMPLE].py +++ b/Scripts/MISCELLANEOUS SCRIPTS/Reinforcement Learning Test Script [SIMPLE].py @@ -2,12 +2,12 @@ import numpy as np -from PsyNeuLink.Components.Functions.Function import PROB -from PsyNeuLink.Components.Functions.Function import Reinforcement, SoftMax -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection -from PsyNeuLink.Scheduling.TimeScale import CentralClock +from psyneulink.components.functions.function import PROB +from psyneulink.components.functions.function import Reinforcement, SoftMax +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.learningprojection import LearningProjection +from psyneulink.scheduling.timescale import CentralClock random.seed(0) np.random.seed(0) diff --git a/Scripts/MISCELLANEOUS SCRIPTS/SEBASTIAN SCRIPT.py b/Scripts/MISCELLANEOUS SCRIPTS/SEBASTIAN SCRIPT.py index 33a651bc9ce..31f6854e73e 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/SEBASTIAN SCRIPT.py +++ b/Scripts/MISCELLANEOUS SCRIPTS/SEBASTIAN SCRIPT.py @@ -1,10 +1,10 @@ # from PsyNeuLink.Components.Functions.Function import Logistic, random_matrix -from PsyNeuLink.Components.Functions.Function import Logistic -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.System import system +from psyneulink.components.functions.function import Logistic +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.learningprojection import LearningProjection +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.system import system # set up layers diff --git a/Scripts/MISCELLANEOUS SCRIPTS/System Learning Test Script.py b/Scripts/MISCELLANEOUS SCRIPTS/System Learning Test Script.py index b2469ab4aab..ab412260a7f 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/System Learning Test Script.py +++ b/Scripts/MISCELLANEOUS SCRIPTS/System Learning Test Script.py @@ -1,7 +1,7 @@ -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.System import * +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.projections.modulatory.learningprojection import LearningProjection +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.system import * # from PsyNeuLink.Globals.Run import run, construct_inputs diff --git a/Scripts/MISCELLANEOUS SCRIPTS/System Test Script.py b/Scripts/MISCELLANEOUS SCRIPTS/System Test Script.py index 4e81288ac4c..8fff4dbb024 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/System Test Script.py +++ b/Scripts/MISCELLANEOUS SCRIPTS/System Test Script.py @@ -1,7 +1,7 @@ -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import Process_Base -from PsyNeuLink.Components.System import System_Base -from PsyNeuLink.Globals.Keywords import * +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import Process_Base +from psyneulink.components.system import System_Base +from psyneulink.globals.keywords import * # DDM_prefs = ComponentPreferenceSet( # prefs = { diff --git a/Scripts/MISCELLANEOUS SCRIPTS/Test Script.py b/Scripts/MISCELLANEOUS SCRIPTS/Test Script.py index ea89413286d..6a058cf9692 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/Test Script.py +++ b/Scripts/MISCELLANEOUS SCRIPTS/Test Script.py @@ -1,5 +1,5 @@ -from PsyNeuLink.Components.Process import Process_Base -from PsyNeuLink.Globals.Keywords import * +from psyneulink.components.process import Process_Base +from psyneulink.globals.keywords import * # x = Process_Base() # x.execute(10.0) diff --git a/Scripts/MISCELLANEOUS SCRIPTS/Transfer Mechanism Test Script.py b/Scripts/MISCELLANEOUS SCRIPTS/Transfer Mechanism Test Script.py index 886fe07f866..c35307b3cd6 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/Transfer Mechanism Test Script.py +++ b/Scripts/MISCELLANEOUS SCRIPTS/Transfer Mechanism Test Script.py @@ -1,7 +1,7 @@ -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * +from psyneulink.components.mechanisms.processing.transfermechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Globals.Keywords import * +from psyneulink.components.process import process +from psyneulink.globals.keywords import * my_Transfer = TransferMechanism(name='my_Transfer', default_variable = [0,0], diff --git a/Scripts/MISCELLANEOUS SCRIPTS/TutorialScript.py b/Scripts/MISCELLANEOUS SCRIPTS/TutorialScript.py index 151addbc4d5..1f501fe1d6a 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/TutorialScript.py +++ b/Scripts/MISCELLANEOUS SCRIPTS/TutorialScript.py @@ -1,5 +1,5 @@ -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import * +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import * # simple_ddm_process = process('Simple DDM Process') # simple_ddm_process.execute([1]) diff --git a/Scripts/MISCELLANEOUS SCRIPTS/Two Layer Test Script.py b/Scripts/MISCELLANEOUS SCRIPTS/Two Layer Test Script.py index e21505139d8..9a15c9b88f5 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/Two Layer Test Script.py +++ b/Scripts/MISCELLANEOUS SCRIPTS/Two Layer Test Script.py @@ -1,7 +1,7 @@ -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.System import system +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.system import system # from PsyNeuLink.Globals.Run import run, construct_inputs diff --git a/Scripts/MISCELLANEOUS SCRIPTS/ddm-bug.py b/Scripts/MISCELLANEOUS SCRIPTS/ddm-bug.py index ff86afdc39f..3c7e473d306 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/ddm-bug.py +++ b/Scripts/MISCELLANEOUS SCRIPTS/ddm-bug.py @@ -1,8 +1,8 @@ import time -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Globals.Keywords import * +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import process +from psyneulink.globals.keywords import * print("========TIME STEP MODE========") print() diff --git a/Scripts/MISCELLANEOUS SCRIPTS/mechanism-generator-test.py b/Scripts/MISCELLANEOUS SCRIPTS/mechanism-generator-test.py index c9d8877e769..bc42068b364 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/mechanism-generator-test.py +++ b/Scripts/MISCELLANEOUS SCRIPTS/mechanism-generator-test.py @@ -1,8 +1,8 @@ -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import * -from PsyNeuLink.mechanismGenerator import mechanismGenerator +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import process +from psyneulink.components.system import system +from psyneulink.globals.keywords import * +from psyneulink.mechanismGenerator import mechanismGenerator mechanism1 = TransferMechanism(name='my_Transfer1', default_variable = [0], diff --git a/Scripts/MISCELLANEOUS SCRIPTS/rate_bug.py b/Scripts/MISCELLANEOUS SCRIPTS/rate_bug.py index 85395aa98f7..3b39ac59137 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/rate_bug.py +++ b/Scripts/MISCELLANEOUS SCRIPTS/rate_bug.py @@ -1,13 +1,13 @@ from pprint import pprint -from PsyNeuLink.Components.Functions.Function import Integrator, BogaczEtAl -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.IntegratorMechanisms import DDM +from psyneulink.components.functions.function import Integrator, BogaczEtAl +from psyneulink.components.process import process +from psyneulink.library.mechanisms.processing.integrator import ddm def test_DDM_rate_int(): stim = 10 - D = DDM( + D = ddm( name='DDM', function = Integrator( integration_type= DIFFUSION, @@ -30,7 +30,7 @@ def test_DDM_rate_int(): def test_DDM_rate_list_len_1(): stim = 10 - D_2 = DDM( + D_2 = ddm( name='DDM', function=Integrator( integration_type=DIFFUSION, @@ -52,7 +52,7 @@ def test_DDM_rate_list_len_1(): def test_DDM_rate_int_bog(): stim = 10 - D_bog = DDM( + D_bog = ddm( name='DDM', function = BogaczEtAl(drift_rate=5) ) @@ -69,7 +69,7 @@ def test_DDM_rate_int_bog(): def test_DDM_rate_list_len_1_bog(): stim = 10 - D_2_bog = DDM( + D_2_bog = ddm( name='DDM', function=BogaczEtAl(drift_rate=[5, 5]) ) diff --git a/Scripts/MISCELLANEOUS SCRIPTS/testing_mechanisms.py b/Scripts/MISCELLANEOUS SCRIPTS/testing_mechanisms.py index bf3853fc6e5..a10e7939de6 100644 --- a/Scripts/MISCELLANEOUS SCRIPTS/testing_mechanisms.py +++ b/Scripts/MISCELLANEOUS SCRIPTS/testing_mechanisms.py @@ -1,11 +1,11 @@ -from PsyNeuLink.Components.Functions.Function import Linear, SimpleIntegrator -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms import IntegratorMechanism -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Globals.Keywords import EXECUTING -from PsyNeuLink.Scheduling.TimeScale import TimeScale +from psyneulink.components.functions.function import Linear, SimpleIntegrator +from psyneulink.components.mechanisms.processing import integratormechanism +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.globals.keywords import EXECUTING +from psyneulink.scheduling.timescale import TimeScale -I = IntegratorMechanism( +I = integratormechanism( name='IntegratorMechanism', function=SimpleIntegrator( ), @@ -68,7 +68,7 @@ # print([val, val2] == [5.0, 1.0]) def test_mechanisms_without_system_or_process_no_input(): - I = IntegratorMechanism( + I = integratormechanism( name='IntegratorMechanism', default_variable= 10, function=SimpleIntegrator( diff --git a/Scripts/Models/GilzenratModel.py b/Scripts/Models/GilzenratModel.py index a41ae127901..5cf7d74ab70 100644 --- a/Scripts/Models/GilzenratModel.py +++ b/Scripts/Models/GilzenratModel.py @@ -6,18 +6,18 @@ """ import numpy as np -from PsyNeuLink.Components.Functions.Function import Linear, Logistic -from PsyNeuLink.Components.Functions.Function import ModulationParam -from PsyNeuLink.Components.System import system -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ObjectiveMechanism import ObjectiveMechanism -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.TransferMechanisms.RecurrentTransferMechanism \ +from psyneulink.components.functions.function import Linear, Logistic +from psyneulink.components.functions.function import ModulationParam +from psyneulink.components.system import system +from psyneulink.components.process import process +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.mechanisms.processing.objectivemechanism import ObjectiveMechanism +from psyneulink.library.mechanisms.processing.transfer.recurrenttransfermechanism \ import RecurrentTransferMechanism -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.TransferMechanisms.LCA import LCA -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Library.Subsystems.AGT.LCControlMechanism import LCControlMechanism -from PsyNeuLink.Globals.Keywords import FULL_CONNECTIVITY_MATRIX, VALUE, PROJECTIONS +from psyneulink.library.mechanisms.processing.transfer.lca import LCA +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.library.subsystems.agt.lccontrolmechanism import LCControlMechanism +from psyneulink.globals.keywords import FULL_CONNECTIVITY_MATRIX, VALUE, PROJECTIONS input_layer = TransferMechanism(size=2, diff --git a/Scripts/Scratch Pad.py b/Scripts/Scratch Pad.py index d1215663cbd..a6e8c393e49 100644 --- a/Scripts/Scratch Pad.py +++ b/Scripts/Scratch Pad.py @@ -1034,13 +1034,13 @@ def __init__(self, error_value): # region TEST RecurrentTransferMechanism @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ import numpy as np -from PsyNeuLink.Components.Functions.Function import Logistic -from PsyNeuLink.Globals.Keywords import LEARNING -from PsyNeuLink.Components.System import system -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.TransferMechanisms.RecurrentTransferMechanism \ +from psyneulink.components.functions.function import Logistic +from psyneulink.globals.keywords import LEARNING +from psyneulink.components.system import system +from psyneulink.components.process import process +from psyneulink.library.mechanisms.processing.transfer.recurrenttransfermechanism \ import RecurrentTransferMechanism -from PsyNeuLink.Components.Functions.Function import Linear +from psyneulink.components.functions.function import Linear print("\nTEST RecurrentTransferMechanism\n") diff --git a/Scripts/TEST SCRIPTS/DDM Test Script.py b/Scripts/TEST SCRIPTS/DDM Test Script.py index b2020e85118..7b1e93650c0 100644 --- a/Scripts/TEST SCRIPTS/DDM Test Script.py +++ b/Scripts/TEST SCRIPTS/DDM Test Script.py @@ -1,5 +1,5 @@ -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Globals.Keywords import * +from psyneulink.components.process import process +from psyneulink.globals.keywords import * DDM_prefs = ComponentPreferenceSet( prefs = { diff --git a/Scripts/TEST SCRIPTS/Documentation Examples Script.py b/Scripts/TEST SCRIPTS/Documentation Examples Script.py index 5c384eb2478..ecd237d2839 100644 --- a/Scripts/TEST SCRIPTS/Documentation Examples Script.py +++ b/Scripts/TEST SCRIPTS/Documentation Examples Script.py @@ -2,11 +2,11 @@ # Runs examples in the PsyNeuLink Documentation # -from PsyNeuLink.Components.Functions.Function import * -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.IntegratorMechanisms import DDM +from psyneulink.components.functions.function import * +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.library.mechanisms.processing.integrator import ddm # from PsyNeuLink.Components.Functions.Function import Logistic, random_matrix @@ -105,7 +105,7 @@ # Specification of mechanisms in a pathway mechanism_1 = TransferMechanism() -mechanism_2 = DDM() +mechanism_2 = ddm() some_params = {PARAMETER_STATE_PARAMS:{THRESHOLD:2,NOISE:0.1}} my_process = process(pathway=[mechanism_1, TransferMechanism, (mechanism_2, some_params)]) print(my_process.execute()) @@ -113,21 +113,21 @@ # Default projection specification mechanism_1 = TransferMechanism() mechanism_2 = TransferMechanism() -mechanism_3 = DDM() +mechanism_3 = ddm() my_process = process(pathway=[mechanism_1, mechanism_2, mechanism_3]) print(my_process.execute()) # Inline projection specification using an existing projection mechanism_1 = TransferMechanism() mechanism_2 = TransferMechanism() -mechanism_3 = DDM() +mechanism_3 = ddm() projection_A = MappingProjection() my_process = process(pathway=[mechanism_1, projection_A, mechanism_2, mechanism_3]) print(my_process.execute()) mechanism_1 = TransferMechanism() mechanism_2 = TransferMechanism() -mechanism_3 = DDM() +mechanism_3 = ddm() # Inline projection specification using a keyword my_process = process(pathway=[mechanism_1, RANDOM_CONNECTIVITY_MATRIX, mechanism_2, mechanism_3]) print(my_process.execute()) @@ -135,7 +135,7 @@ # Stand-alone projection specification mechanism_1 = TransferMechanism() mechanism_2 = TransferMechanism() -mechanism_3 = DDM() +mechanism_3 = ddm() projection_A = MappingProjection(sender=mechanism_1, receiver=mechanism_2) my_process = process(pathway=[mechanism_1, mechanism_2, mechanism_3]) print(my_process.execute()) diff --git a/Scripts/TEST SCRIPTS/EVC System Laming Validation Test Script.py b/Scripts/TEST SCRIPTS/EVC System Laming Validation Test Script.py index a8d151e04b5..a7f327ae5cb 100644 --- a/Scripts/TEST SCRIPTS/EVC System Laming Validation Test Script.py +++ b/Scripts/TEST SCRIPTS/EVC System Laming Validation Test Script.py @@ -1,14 +1,14 @@ # from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.Deprecated.LinearMechanism import * -from PsyNeuLink.Components.Mechanisms.Mechanism import MonitoredOutputStatesOption -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import * -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import * -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.IntegratorMechanisms.DDM import * -from PsyNeuLink.Library.Subsystems.EVC.EVCControlMechanism import EVCControlMechanism +from psyneulink.components.mechanisms.mechanism import MonitoredOutputStatesOption +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection +from psyneulink.components.system import system +from psyneulink.globals.keywords import * +from psyneulink.globals.preferences.componentpreferenceset import * +from psyneulink.library.mechanisms.processing.integrator.ddm import * +from psyneulink.library.subsystems.evc.evccontrolmechanism import EVCControlMechanism random.seed(0) np.random.seed(0) diff --git a/Scripts/TEST SCRIPTS/META Test Script.py b/Scripts/TEST SCRIPTS/META Test Script.py index f0bdd38f900..64fc6b3da6f 100644 --- a/Scripts/TEST SCRIPTS/META Test Script.py +++ b/Scripts/TEST SCRIPTS/META Test Script.py @@ -2,7 +2,7 @@ import random import subprocess import sys -import PsyNeuLink.Globals.Preferences.ComponentPreferenceSet +import psyneulink.globals.preferences.componentpreferenceset # Insures that runs are deterministic for use in Jenkins testing diff --git a/Scripts/TEST SCRIPTS/Mixed NN & DDM script.py b/Scripts/TEST SCRIPTS/Mixed NN & DDM script.py index 477342bf38d..2c3cde78f33 100644 --- a/Scripts/TEST SCRIPTS/Mixed NN & DDM script.py +++ b/Scripts/TEST SCRIPTS/Mixed NN & DDM script.py @@ -1,8 +1,8 @@ -from PsyNeuLink.Components.Functions.Function import * -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import * -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Globals.Run import run -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.IntegratorMechanisms.DDM import * +from psyneulink.components.functions.function import * +from psyneulink.components.mechanisms.processing.transfermechanism import * +from psyneulink.components.process import process +from psyneulink.globals.run import run +from psyneulink.library.mechanisms.processing.integrator.ddm import * # import random # random.seed(0) diff --git a/Scripts/TEST SCRIPTS/Multilayer Learning Test Script.py b/Scripts/TEST SCRIPTS/Multilayer Learning Test Script.py index 4937c77df1f..3d2950be3bc 100644 --- a/Scripts/TEST SCRIPTS/Multilayer Learning Test Script.py +++ b/Scripts/TEST SCRIPTS/Multilayer Learning Test Script.py @@ -1,12 +1,12 @@ -from PsyNeuLink.Components.Functions.Function import Logistic -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.States.OutputState import * -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import * -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import * -from PsyNeuLink.Scheduling.Condition import AfterNCalls -from PsyNeuLink.Scheduling.TimeScale import TimeScale, CentralClock +from psyneulink.components.functions.function import Logistic +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.states.outputstate import * +from psyneulink.components.system import system +from psyneulink.globals.keywords import * +from psyneulink.globals.preferences.componentpreferenceset import * +from psyneulink.scheduling.condition import AfterNCalls +from psyneulink.scheduling.timescale import TimeScale, CentralClock # from PsyNeuLink.Globals.Run import run, construct_inputs diff --git a/Scripts/TEST SCRIPTS/Reinforcement Learning Test Script.py b/Scripts/TEST SCRIPTS/Reinforcement Learning Test Script.py index 2eceea2d1fe..bccc77daff5 100644 --- a/Scripts/TEST SCRIPTS/Reinforcement Learning Test Script.py +++ b/Scripts/TEST SCRIPTS/Reinforcement Learning Test Script.py @@ -2,13 +2,13 @@ import numpy as np -from PsyNeuLink.Components.Functions.Function import PROB -from PsyNeuLink.Components.Functions.Function import Reinforcement, SoftMax -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Scheduling.TimeScale import CentralClock +from psyneulink.components.functions.function import PROB +from psyneulink.components.functions.function import Reinforcement, SoftMax +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.learningprojection import LearningProjection +from psyneulink.components.system import system +from psyneulink.scheduling.timescale import CentralClock random.seed(0) np.random.seed(0) diff --git a/Scripts/TEST SCRIPTS/Stroop Model Learning Test Script.py b/Scripts/TEST SCRIPTS/Stroop Model Learning Test Script.py index 0363c73ac8e..60a5d38ec03 100644 --- a/Scripts/TEST SCRIPTS/Stroop Model Learning Test Script.py +++ b/Scripts/TEST SCRIPTS/Stroop Model Learning Test Script.py @@ -1,9 +1,9 @@ -from PsyNeuLink.Components.Functions.Function import Linear, Logistic -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.System import * -from PsyNeuLink.Globals.Keywords import * -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import REPORT_OUTPUT_PREF, VERBOSE_PREF +from psyneulink.components.functions.function import Linear, Logistic +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.system import * +from psyneulink.globals.keywords import * +from psyneulink.globals.preferences.componentpreferenceset import REPORT_OUTPUT_PREF, VERBOSE_PREF process_prefs = {REPORT_OUTPUT_PREF: True, VERBOSE_PREF: False} diff --git a/Scripts/TEST SCRIPTS/Stroop Model Test Script.py b/Scripts/TEST SCRIPTS/Stroop Model Test Script.py index e0f298009cd..afde45598f8 100644 --- a/Scripts/TEST SCRIPTS/Stroop Model Test Script.py +++ b/Scripts/TEST SCRIPTS/Stroop Model Test Script.py @@ -1,8 +1,8 @@ -from PsyNeuLink.Components.Functions.Function import Linear, Logistic -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.System import * -from PsyNeuLink.Globals.Keywords import * -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import REPORT_OUTPUT_PREF, VERBOSE_PREF +from psyneulink.components.functions.function import Linear, Logistic +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.system import * +from psyneulink.globals.keywords import * +from psyneulink.globals.preferences.componentpreferenceset import REPORT_OUTPUT_PREF, VERBOSE_PREF process_prefs = {REPORT_OUTPUT_PREF: True, VERBOSE_PREF: False} diff --git a/Scripts/TEST SCRIPTS/System Graph and Input Test Script.py b/Scripts/TEST SCRIPTS/System Graph and Input Test Script.py index cc907e89d7e..a41fcc4ad15 100644 --- a/Scripts/TEST SCRIPTS/System Graph and Input Test Script.py +++ b/Scripts/TEST SCRIPTS/System Graph and Input Test Script.py @@ -1,6 +1,6 @@ -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.System import system +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.system import system # from PsyNeuLink.Globals.Run import run, construct_inputs # from PsyNeuLink.Components.Process import MappingProjection diff --git a/PsyNeuLink/__init__.py b/psyneulink/__init__.py similarity index 73% rename from PsyNeuLink/__init__.py rename to psyneulink/__init__.py index 7a31678089d..6fa318d8124 100644 --- a/PsyNeuLink/__init__.py +++ b/psyneulink/__init__.py @@ -9,23 +9,23 @@ # *********************************************** Init **************************************************************** import logging -from PsyNeuLink.Components.Functions.Function import BackPropagation, Exponential, FunctionOutputType, Integrator, \ +from psyneulink.components.functions.function import BackPropagation, Exponential, FunctionOutputType, Integrator, \ Linear, LinearCombination, LinearMatrix, Logistic, SoftMax, UserDefinedFunction -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection -from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Globals.Keywords import ALL, DEFAULT_MATRIX, EXPONENTS, FULL_CONNECTIVITY_MATRIX, FUNCTION, \ +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection +from psyneulink.components.projections.modulatory.learningprojection import LearningProjection +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.globals.keywords import ALL, DEFAULT_MATRIX, EXPONENTS, FULL_CONNECTIVITY_MATRIX, FUNCTION, \ FUNCTION_PARAMS, HOLLOW_MATRIX, IDENTITY_MATRIX, INITIALIZER, INPUT_STATES, MATRIX, \ MAX_INDICATOR, MAX_VAL, MONITOR_FOR_CONTROL, OFFSET, OPERATION, OUTPUT_STATES, PARAMETER_STATES, PROB, SCALE, \ WEIGHTS -from PsyNeuLink.Components.ShellClasses import System -from PsyNeuLink.Components.System import system -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.IntegratorMechanisms import DDM -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.ObjectiveMechanisms.ComparatorMechanism import \ +from psyneulink.components.shellclasses import System +from psyneulink.components.system import system +from psyneulink.library.mechanisms.processing.integrator import ddm +from psyneulink.library.mechanisms.processing.objective.comparatormechanism import \ ComparatorMechanism -from PsyNeuLink.Scheduling.TimeScale import CentralClock +from psyneulink.scheduling.timescale import CentralClock # https://stackoverflow.com/a/17276457/3131666 @@ -48,8 +48,8 @@ def filter(self, record): ) for handler in logging.root.handlers: handler.addFilter(Blacklist( - 'PsyNeuLink.Scheduling.Scheduler', - 'PsyNeuLink.Scheduling.Condition', + 'psyneulink.scheduling.scheduler', + 'psyneulink.scheduling.condition', )) __all__ = ['System', @@ -58,7 +58,7 @@ def filter(self, record): 'CentralClock', 'TransferMechanism', 'IntegratorMechanism', - 'DDM', + 'ddm.py', 'EVCControlMechanism', 'ComparatorMechanism', 'MappingProjection', diff --git a/PsyNeuLink/Components/__init__.py b/psyneulink/components/__init__.py similarity index 89% rename from PsyNeuLink/Components/__init__.py rename to psyneulink/components/__init__.py index c9ff995435c..1fe1d57af5b 100644 --- a/PsyNeuLink/Components/__init__.py +++ b/psyneulink/components/__init__.py @@ -17,8 +17,8 @@ import inspect -from PsyNeuLink.Globals.Keywords import DEFAULT_PROCESSING_MECHANISM, PROJECTION_SENDER, PROJECTION_TYPE -from PsyNeuLink.Globals.Registry import register_category +from psyneulink.globals.keywords import DEFAULT_PROCESSING_MECHANISM, PROJECTION_SENDER, PROJECTION_TYPE +from psyneulink.globals.registry import register_category kwInitPy = '__init__.py' @@ -32,18 +32,18 @@ def __str__(self): #region ***************************************** MECHANISM SUBCLASSES ************************************************* -from PsyNeuLink.Components.Mechanisms.Mechanism import MechanismRegistry -from PsyNeuLink.Components.Mechanisms.Mechanism import Mechanism_Base -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.DefaultProcessingMechanism \ +from psyneulink.components.mechanisms.mechanism import MechanismRegistry +from psyneulink.components.mechanisms.mechanism import Mechanism_Base +from psyneulink.components.mechanisms.processing.defaultprocessingmechanism \ import DefaultProcessingMechanism_Base -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.ControlMechanism.ControlMechanism \ +from psyneulink.components.mechanisms.adaptive.control.controlmechanism \ import ControlMechanism register_category(entry=ControlMechanism, base_class=Mechanism_Base, registry=MechanismRegistry, context=kwInitPy) -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.ControlMechanism.DefaultControlMechanism \ +from psyneulink.components.mechanisms.adaptive.control.defaultcontrolmechanism \ import DefaultControlMechanism register_category(entry=DefaultControlMechanism, base_class=Mechanism_Base, @@ -51,7 +51,7 @@ def __str__(self): context=kwInitPy) # DDM (used as DefaultMechanism) -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.IntegratorMechanisms.DDM import DDM +from psyneulink.library.mechanisms.processing.integrator.ddm import DDM register_category(entry=DDM, base_class=Mechanism_Base, registry=MechanismRegistry, @@ -90,25 +90,25 @@ def __str__(self): # while still indexing multiple uses of the same base name within an owner # # State registry -from PsyNeuLink.Components.States.State import StateRegistry -from PsyNeuLink.Components.States.State import State_Base +from psyneulink.components.states.state import StateRegistry +from psyneulink.components.states.state import State_Base # InputState -from PsyNeuLink.Components.States.InputState import InputState +from psyneulink.components.states.inputstate import InputState register_category(entry=InputState, base_class=State_Base, registry=StateRegistry, context=kwInitPy) # OutputState -from PsyNeuLink.Components.States.OutputState import OutputState +from psyneulink.components.states.outputstate import OutputState register_category(entry=OutputState, base_class=State_Base, registry=StateRegistry, context=kwInitPy) # ParameterState -from PsyNeuLink.Components.States.ParameterState import ParameterState +from psyneulink.components.states.parameterstate import ParameterState register_category(entry=ParameterState, base_class=State_Base, registry=StateRegistry, @@ -117,25 +117,25 @@ def __str__(self): # Projection ----------------------------------------------------------------------------------------------------------- # Projection registry -from PsyNeuLink.Components.Projections.Projection import ProjectionRegistry -from PsyNeuLink.Components.Projections.Projection import Projection_Base +from psyneulink.components.projections.projection import ProjectionRegistry +from psyneulink.components.projections.projection import Projection_Base # MappingProjection -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection register_category(entry=MappingProjection, base_class=Projection_Base, registry=ProjectionRegistry, context=kwInitPy) # ControlProjection -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection register_category(entry=ControlProjection, base_class=Projection_Base, registry=ProjectionRegistry, context=kwInitPy) # LearningProjection -from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection +from psyneulink.components.projections.modulatory.learningprojection import LearningProjection register_category(entry=LearningProjection, base_class=Projection_Base, registry=ProjectionRegistry, @@ -229,23 +229,23 @@ def __str__(self): #region ***************************************** CLASS _PREFERENCES *************************************************** -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet \ +from psyneulink.globals.preferences.componentpreferenceset \ import ComponentPreferenceSet, ComponentDefaultPrefDicts, PreferenceLevel -from PsyNeuLink.Components.ShellClasses import System +from psyneulink.components.shellclasses import System System.classPreferences = ComponentPreferenceSet(owner=System, prefs=ComponentDefaultPrefDicts[PreferenceLevel.INSTANCE], level=PreferenceLevel.INSTANCE, context=".__init__.py") -from PsyNeuLink.Components.ShellClasses import Process +from psyneulink.components.shellclasses import Process Process.classPreferences = ComponentPreferenceSet(owner=Process, prefs=ComponentDefaultPrefDicts[PreferenceLevel.INSTANCE], level=PreferenceLevel.INSTANCE, context=".__init__.py") -from PsyNeuLink.Components.ShellClasses import Mechanism +from psyneulink.components.shellclasses import Mechanism Mechanism.classPreferences = ComponentPreferenceSet(owner=Mechanism, prefs=ComponentDefaultPrefDicts[PreferenceLevel.CATEGORY], level=PreferenceLevel.TYPE, @@ -257,7 +257,7 @@ def __str__(self): context=".__init__.py") -from PsyNeuLink.Components.ShellClasses import State +from psyneulink.components.shellclasses import State State.classPreferences = ComponentPreferenceSet(owner=State, prefs=ComponentDefaultPrefDicts[PreferenceLevel.CATEGORY], level=PreferenceLevel.CATEGORY, @@ -273,13 +273,13 @@ def __str__(self): level=PreferenceLevel.TYPE, context=".__init__.py") -from PsyNeuLink.Components.ShellClasses import Projection +from psyneulink.components.shellclasses import Projection Projection.classPreferences = ComponentPreferenceSet(owner=Projection, prefs=ComponentDefaultPrefDicts[PreferenceLevel.CATEGORY], level=PreferenceLevel.CATEGORY, context=".__init__.py") -from PsyNeuLink.Components.Functions.Function import Function +from psyneulink.components.functions.function import Function Function.classPreferences = ComponentPreferenceSet(owner=Function, prefs=ComponentDefaultPrefDicts[PreferenceLevel.CATEGORY], level=PreferenceLevel.CATEGORY, diff --git a/PsyNeuLink/Components/Component.py b/psyneulink/components/component.py similarity index 98% rename from PsyNeuLink/Components/Component.py rename to psyneulink/components/component.py index acfcaa48210..6ec6cfd4df7 100644 --- a/PsyNeuLink/Components/Component.py +++ b/psyneulink/components/component.py @@ -345,11 +345,11 @@ class `UserList ` for details). """ - from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection - from PsyNeuLink.Components.States.ParameterState import ParameterState + from psyneulink.components.projections.pathway.mappingprojection import MappingProjection + from psyneulink.components.states.parameterstate import ParameterState componentName = STABILITY_FUNCTION @@ -7563,8 +7563,8 @@ def _validate_params(self, request_set, target_set=None, context=None): # Validate error_matrix specification if MATRIX in target_set: - from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection - from PsyNeuLink.Components.States.ParameterState import ParameterState + from psyneulink.components.projections.pathway.mappingprojection import MappingProjection + from psyneulink.components.states.parameterstate import ParameterState matrix = target_set[MATRIX] @@ -7621,8 +7621,8 @@ def _instantiate_attributes_before_function(self, context=None): size = len(np.squeeze(self.instance_defaults.variable)) - from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection - from PsyNeuLink.Components.States.ParameterState import ParameterState + from psyneulink.components.projections.pathway.mappingprojection import MappingProjection + from psyneulink.components.states.parameterstate import ParameterState if isinstance(self.matrix,MappingProjection): self._matrix = self.matrix._parameter_states[MATRIX] elif isinstance(self.matrix,ParameterState): @@ -7660,7 +7660,7 @@ def function(self, # Validate variable and validate params variable = self._update_variable(self._check_args(variable=variable, params=params, context=context)) - from PsyNeuLink.Components.States.ParameterState import ParameterState + from psyneulink.components.states.parameterstate import ParameterState if isinstance(self.matrix, ParameterState): matrix = self.matrix.value else: @@ -8611,8 +8611,8 @@ def _validate_params(self, request_set, target_set=None, context=None): error_matrix = target_set[ERROR_MATRIX] - from PsyNeuLink.Components.States.ParameterState import ParameterState - from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection + from psyneulink.components.states.parameterstate import ParameterState + from psyneulink.components.projections.pathway.mappingprojection import MappingProjection if not isinstance(error_matrix, (list, np.ndarray, np.matrix, ParameterState, MappingProjection)): raise FunctionError("The {} arg for {} ({}) must be a list, 2d np.array, ParamaterState or " "MappingProjection".format(ERROR_MATRIX, self.__class__.__name__, error_matrix)) @@ -8702,7 +8702,7 @@ def function(self, self._check_args(variable=variable, params=params, context=context) - from PsyNeuLink.Components.States.ParameterState import ParameterState + from psyneulink.components.states.parameterstate import ParameterState if isinstance(self.error_matrix, ParameterState): error_matrix = self.error_matrix.value else: diff --git a/PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/ControlMechanism/__init__.py b/psyneulink/components/mechanisms/__init__.py similarity index 100% rename from PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/ControlMechanism/__init__.py rename to psyneulink/components/mechanisms/__init__.py diff --git a/PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/GatingMechanism/__init__.py b/psyneulink/components/mechanisms/adaptive/__init__.py similarity index 100% rename from PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/GatingMechanism/__init__.py rename to psyneulink/components/mechanisms/adaptive/__init__.py diff --git a/PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/AdaptiveMechanism.py b/psyneulink/components/mechanisms/adaptive/adaptivemechanism.py similarity index 96% rename from PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/AdaptiveMechanism.py rename to psyneulink/components/mechanisms/adaptive/adaptivemechanism.py index 1ef27200326..87c24737b89 100644 --- a/PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/AdaptiveMechanism.py +++ b/psyneulink/components/mechanisms/adaptive/adaptivemechanism.py @@ -93,10 +93,10 @@ """ -from PsyNeuLink.Components.Mechanisms.Mechanism import Mechanism_Base -from PsyNeuLink.Globals.Defaults import defaultControlAllocation -from PsyNeuLink.Globals.Keywords import ADAPTIVE_MECHANISM -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel +from psyneulink.components.mechanisms.mechanism import Mechanism_Base +from psyneulink.globals.defaults import defaultControlAllocation +from psyneulink.globals.keywords import ADAPTIVE_MECHANISM +from psyneulink.globals.preferences.preferenceset import PreferenceLevel class AdaptiveMechanismError(Exception): diff --git a/PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/LearningMechanism/__init__.py b/psyneulink/components/mechanisms/adaptive/control/__init__.py similarity index 100% rename from PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/LearningMechanism/__init__.py rename to psyneulink/components/mechanisms/adaptive/control/__init__.py diff --git a/PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/ControlMechanism/ControlMechanism.py b/psyneulink/components/mechanisms/adaptive/control/controlmechanism.py similarity index 96% rename from PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/ControlMechanism/ControlMechanism.py rename to psyneulink/components/mechanisms/adaptive/control/controlmechanism.py index c3c98e5b7b4..9a3d25365c9 100644 --- a/PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/ControlMechanism/ControlMechanism.py +++ b/psyneulink/components/mechanisms/adaptive/control/controlmechanism.py @@ -300,22 +300,22 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Component import InitStatus -from PsyNeuLink.Components.Functions.Function import LinearCombination, ModulationParam, _is_modulation_param -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.AdaptiveMechanism import AdaptiveMechanism_Base -from PsyNeuLink.Components.Mechanisms.Mechanism import Mechanism_Base, MonitoredOutputStatesOption -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ObjectiveMechanism import EXPONENT_INDEX, MONITORED_OUTPUT_STATES, ObjectiveMechanism, ObjectiveMechanismError, WEIGHT_INDEX, _parse_monitored_output_states -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.Projections.Projection import _validate_receiver -from PsyNeuLink.Components.ShellClasses import Mechanism, System -from PsyNeuLink.Components.States.ModulatorySignals.ControlSignal import _parse_control_signal_spec -from PsyNeuLink.Components.States.OutputState import OutputState -from PsyNeuLink.Globals.Defaults import defaultControlAllocation -from PsyNeuLink.Globals.Keywords import AUTO_ASSIGN_MATRIX, CONTROL, CONTROLLED_PARAM, CONTROL_PROJECTION, CONTROL_PROJECTIONS, CONTROL_SIGNAL, CONTROL_SIGNALS, INIT__EXECUTE__METHOD_ONLY, MECHANISM, NAME, OBJECTIVE_MECHANISM, OWNER, PARAMETER_STATE, PARAMS, PRODUCT, REFERENCE_VALUE, SYSTEM -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Globals.Utilities import ContentAddressableList -from PsyNeuLink.Scheduling.TimeScale import CentralClock, TimeScale +from psyneulink.components.component import InitStatus +from psyneulink.components.functions.function import LinearCombination, ModulationParam, _is_modulation_param +from psyneulink.components.mechanisms.adaptive.adaptivemechanism import AdaptiveMechanism_Base +from psyneulink.components.mechanisms.mechanism import Mechanism_Base, MonitoredOutputStatesOption +from psyneulink.components.mechanisms.processing.objectivemechanism import EXPONENT_INDEX, MONITORED_OUTPUT_STATES, ObjectiveMechanism, ObjectiveMechanismError, WEIGHT_INDEX, _parse_monitored_output_states +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.projections.projection import _validate_receiver +from psyneulink.components.shellclasses import Mechanism, System +from psyneulink.components.states.modulatorysignals.controlsignal import _parse_control_signal_spec +from psyneulink.components.states.outputstate import OutputState +from psyneulink.globals.defaults import defaultControlAllocation +from psyneulink.globals.keywords import AUTO_ASSIGN_MATRIX, CONTROL, CONTROLLED_PARAM, CONTROL_PROJECTION, CONTROL_PROJECTIONS, CONTROL_SIGNAL, CONTROL_SIGNALS, INIT__EXECUTE__METHOD_ONLY, MECHANISM, NAME, OBJECTIVE_MECHANISM, OWNER, PARAMETER_STATE, PARAMS, PRODUCT, REFERENCE_VALUE, SYSTEM +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.globals.utilities import ContentAddressableList +from psyneulink.scheduling.timescale import CentralClock, TimeScale OBJECTIVE_MECHANISM = 'objective_mechanism' ALLOCATION_POLICY = 'allocation_policy' @@ -492,7 +492,7 @@ class ClassDefaults(AdaptiveMechanism_Base.ClassDefaults): # This must be a list, as there may be more than one (e.g., one per control_signal) variable = defaultControlAllocation - from PsyNeuLink.Components.Functions.Function import Linear + from psyneulink.components.functions.function import Linear paramClassDefaults = Mechanism_Base.paramClassDefaults.copy() paramClassDefaults.update({ OBJECTIVE_MECHANISM: None, @@ -609,7 +609,7 @@ def _validate_params(self, request_set, target_set=None, context=None): ObjectiveMechanism.componentName)) if CONTROL_SIGNALS in target_set and target_set[CONTROL_SIGNALS]: - from PsyNeuLink.Components.States.ModulatorySignals.ControlSignal import ControlSignal + from psyneulink.components.states.modulatorysignals.controlsignal import ControlSignal # # MODIFIED 9/17/17 OLD: # if not isinstance(target_set[CONTROL_SIGNALS], (list, UserList)): # raise ControlMechanismError("{} arg of {} must be list or ContentAddressableList". @@ -717,9 +717,9 @@ def _instantiate_input_states(self, context=None): def _instantiate_output_states(self, context=None): # Create registry for GatingSignals (to manage names) - from PsyNeuLink.Globals.Registry import register_category - from PsyNeuLink.Components.States.ModulatorySignals.ControlSignal import ControlSignal - from PsyNeuLink.Components.States.State import State_Base + from psyneulink.globals.registry import register_category + from psyneulink.components.states.modulatorysignals.controlsignal import ControlSignal + from psyneulink.components.states.state import State_Base register_category(entry=ControlSignal, base_class=State_Base, registry=self._stateRegistry, @@ -770,7 +770,7 @@ def _instantiate_control_signal(self, control_signal=None, context=None): Returns ControlSignal (OutputState) """ - from PsyNeuLink.Components.States.ModulatorySignals.ControlSignal import ControlSignal + from psyneulink.components.states.modulatorysignals.controlsignal import ControlSignal # from PsyNeuLink.Components.States.ParameterState import _get_parameter_state # from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection @@ -845,8 +845,8 @@ def _instantiate_control_signal(self, control_signal=None, context=None): else: control_signal_name = default_name - from PsyNeuLink.Components.States.ModulatorySignals.ControlSignal import ControlSignal - from PsyNeuLink.Components.States.State import _instantiate_state + from psyneulink.components.states.modulatorysignals.controlsignal import ControlSignal + from psyneulink.components.states.state import _instantiate_state control_signal_params.update({CONTROLLED_PARAM:param_name}) @@ -868,7 +868,7 @@ def _instantiate_control_signal(self, control_signal=None, context=None): if control_projection: _validate_receiver(self, control_projection, Mechanism, CONTROL_SIGNAL, context=context) - from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection + from psyneulink.components.projections.modulatory.controlprojection import ControlProjection if not isinstance(control_projection, ControlProjection): raise ControlMechanismError("PROGRAM ERROR: Attempt to assign {}, " "that is not a ControlProjection, to ControlSignal of {}". @@ -886,7 +886,7 @@ def _instantiate_control_signal(self, control_signal=None, context=None): # Instantiate ControlProjection else: # IMPLEMENTATION NOTE: THIS SHOULD BE MOVED TO COMPOSITION ONCE THAT IS IMPLEMENTED - from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection + from psyneulink.components.projections.modulatory.controlprojection import ControlProjection control_projection = ControlProjection(sender=control_signal, receiver=parameter_state, # name=CONTROL_PROJECTION + control_signal_name) @@ -914,7 +914,7 @@ def _instantiate_control_signal(self, control_signal=None, context=None): try: self._output_states[control_signal.name] = control_signal except (AttributeError, TypeError): - from PsyNeuLink.Components.States.State import State_Base + from psyneulink.components.states.state import State_Base self._output_states = ContentAddressableList(component_type=State_Base, list=[control_signal], name = self.name+'.output_states') diff --git a/PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/ControlMechanism/DefaultControlMechanism.py b/psyneulink/components/mechanisms/adaptive/control/defaultcontrolmechanism.py similarity index 92% rename from PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/ControlMechanism/DefaultControlMechanism.py rename to psyneulink/components/mechanisms/adaptive/control/defaultcontrolmechanism.py index 19253dca0a0..cf9a8e5a4ca 100644 --- a/PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/ControlMechanism/DefaultControlMechanism.py +++ b/psyneulink/components/mechanisms/adaptive/control/defaultcontrolmechanism.py @@ -36,16 +36,16 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.ControlMechanism.ControlMechanism import ControlMechanism -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ObjectiveMechanism import ObjectiveMechanism -from PsyNeuLink.Components.States.InputState import InputState -from PsyNeuLink.Components.States.ParameterState import ParameterState -from PsyNeuLink.Globals.Defaults import defaultControlAllocation -from PsyNeuLink.Globals.Keywords import CONTROL, FUNCTION, FUNCTION_PARAMS, INPUT_STATES, INTERCEPT, MODULATION, NAME, OBJECTIVE_MECHANISM, SLOPE -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Globals.Utilities import ContentAddressableList -from PsyNeuLink.Scheduling.TimeScale import CentralClock, TimeScale +from psyneulink.components.mechanisms.adaptive.control.controlmechanism import ControlMechanism +from psyneulink.components.mechanisms.processing.objectivemechanism import ObjectiveMechanism +from psyneulink.components.states.inputstate import InputState +from psyneulink.components.states.parameterstate import ParameterState +from psyneulink.globals.defaults import defaultControlAllocation +from psyneulink.globals.keywords import CONTROL, FUNCTION, FUNCTION_PARAMS, INPUT_STATES, INTERCEPT, MODULATION, NAME, OBJECTIVE_MECHANISM, SLOPE +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.globals.utilities import ContentAddressableList +from psyneulink.scheduling.timescale import CentralClock, TimeScale class DefaultControlMechanismError(Exception): @@ -92,7 +92,7 @@ class ClassDefaults(ControlMechanism.ClassDefaults): # This must be a list, as there may be more than one (e.g., one per control_signal) variable = defaultControlAllocation - from PsyNeuLink.Components.Functions.Function import Linear + from psyneulink.components.functions.function import Linear paramClassDefaults = ControlMechanism.paramClassDefaults.copy() paramClassDefaults.update({FUNCTION:Linear, FUNCTION_PARAMS:{SLOPE:1, INTERCEPT:0}, @@ -238,8 +238,8 @@ def _instantiate_default_input_state(self, input_state_name, input_state_value, variable_item_index = self.instance_defaults.variable.size-1 # Instantiate inputState - from PsyNeuLink.Components.States.State import _instantiate_state - from PsyNeuLink.Components.States.InputState import InputState + from psyneulink.components.states.state import _instantiate_state + from psyneulink.components.states.inputstate import InputState input_state = _instantiate_state(owner=self, state_type=InputState, state_name=input_state_name, @@ -253,7 +253,7 @@ def _instantiate_default_input_state(self, input_state_name, input_state_value, if self.input_states: self._input_states[input_state.name] = input_state else: - from PsyNeuLink.Components.States.State import State_Base + from psyneulink.components.states.state import State_Base self._input_states = ContentAddressableList(component_type=State_Base, list=[input_state], name=self.name+'.input_states') diff --git a/PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/__init__.py b/psyneulink/components/mechanisms/adaptive/gating/__init__.py similarity index 100% rename from PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/__init__.py rename to psyneulink/components/mechanisms/adaptive/gating/__init__.py diff --git a/PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/GatingMechanism/GatingMechanism.py b/psyneulink/components/mechanisms/adaptive/gating/gatingmechanism.py similarity index 96% rename from PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/GatingMechanism/GatingMechanism.py rename to psyneulink/components/mechanisms/adaptive/gating/gatingmechanism.py index b38bf863cdf..433cfe3deff 100644 --- a/PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/GatingMechanism/GatingMechanism.py +++ b/psyneulink/components/mechanisms/adaptive/gating/gatingmechanism.py @@ -149,20 +149,20 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Component import InitStatus -from PsyNeuLink.Components.Functions.Function import ModulationParam, _is_modulation_param -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.AdaptiveMechanism import AdaptiveMechanism_Base -from PsyNeuLink.Components.Mechanisms.Mechanism import Mechanism_Base -from PsyNeuLink.Components.Projections.Projection import _validate_receiver -from PsyNeuLink.Components.ShellClasses import Mechanism -from PsyNeuLink.Components.States.ModulatorySignals.GatingSignal import GatingSignal, _parse_gating_signal_spec -from PsyNeuLink.Components.States.State import State_Base, _instantiate_state -from PsyNeuLink.Globals.Defaults import defaultGatingPolicy -from PsyNeuLink.Globals.Keywords import GATING_POLICY, GATING_PROJECTION, GATING_PROJECTIONS, GATING_SIGNAL, GATING_SIGNALS, GATING_SIGNAL_SPECS, INIT__EXECUTE__METHOD_ONLY, MAKE_DEFAULT_GATING_MECHANISM, NAME, OWNER, PARAMS, REFERENCE_VALUE, STATES -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Globals.Utilities import ContentAddressableList -from PsyNeuLink.Scheduling.TimeScale import CentralClock, TimeScale +from psyneulink.components.component import InitStatus +from psyneulink.components.functions.function import ModulationParam, _is_modulation_param +from psyneulink.components.mechanisms.adaptive.adaptivemechanism import AdaptiveMechanism_Base +from psyneulink.components.mechanisms.mechanism import Mechanism_Base +from psyneulink.components.projections.projection import _validate_receiver +from psyneulink.components.shellclasses import Mechanism +from psyneulink.components.states.modulatorysignals.gatingsignal import GatingSignal, _parse_gating_signal_spec +from psyneulink.components.states.state import State_Base, _instantiate_state +from psyneulink.globals.defaults import defaultGatingPolicy +from psyneulink.globals.keywords import GATING_POLICY, GATING_PROJECTION, GATING_PROJECTIONS, GATING_SIGNAL, GATING_SIGNALS, GATING_SIGNAL_SPECS, INIT__EXECUTE__METHOD_ONLY, MAKE_DEFAULT_GATING_MECHANISM, NAME, OWNER, PARAMS, REFERENCE_VALUE, STATES +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.globals.utilities import ContentAddressableList +from psyneulink.scheduling.timescale import CentralClock, TimeScale GatingMechanismRegistry = {} @@ -308,7 +308,7 @@ class ClassDefaults(AdaptiveMechanism_Base.ClassDefaults): # This must be a list, as there may be more than one (e.g., one per GATING_SIGNAL) variable = defaultGatingPolicy - from PsyNeuLink.Components.Functions.Function import Linear + from psyneulink.components.functions.function import Linear paramClassDefaults = Mechanism_Base.paramClassDefaults.copy() paramClassDefaults.update({GATING_PROJECTIONS: None}) @@ -361,7 +361,7 @@ def _validate_params(self, request_set, target_set=None, context=None): def _instantiate_output_states(self, context=None): # Create registry for GatingSignals (to manage names) - from PsyNeuLink.Globals.Registry import register_category + from psyneulink.globals.registry import register_category register_category(entry=GatingSignal, base_class=State_Base, registry=self._stateRegistry, @@ -406,7 +406,7 @@ def _instantiate_gating_signal(self, gating_signal=None, context=None): Returns GatingSignal (OutputState) """ - from PsyNeuLink.Components.Projections.ModulatoryProjections.GatingProjection import GatingProjection + from psyneulink.components.projections.modulatory.gatingprojection import GatingProjection # EXTEND gating_policy TO ACCOMMODATE NEW GatingSignal ------------------------------------------------- # also used to determine constraint on GatingSignal value diff --git a/PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/__init__.py b/psyneulink/components/mechanisms/adaptive/learning/__init__.py similarity index 100% rename from PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/__init__.py rename to psyneulink/components/mechanisms/adaptive/learning/__init__.py diff --git a/PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/LearningMechanism/LearningAuxilliary.py b/psyneulink/components/mechanisms/adaptive/learning/learningauxilliary.py similarity index 98% rename from PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/LearningMechanism/LearningAuxilliary.py rename to psyneulink/components/mechanisms/adaptive/learning/learningauxilliary.py index aa407d4d1bf..f00a51f6be4 100644 --- a/PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/LearningMechanism/LearningAuxilliary.py +++ b/psyneulink/components/mechanisms/adaptive/learning/learningauxilliary.py @@ -133,19 +133,19 @@ import numpy as np -from PsyNeuLink.Components.Component import function_type, method_type -from PsyNeuLink.Components.Functions.Function import BackPropagation, Hebbian, Linear, Reinforcement -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.LearningMechanism.LearningMechanism import ACTIVATION_INPUT, ACTIVATION_OUTPUT, ERROR_SIGNAL, LearningMechanism -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ObjectiveMechanism import ObjectiveMechanism -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ProcessingMechanism import ProcessingMechanism_Base -from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.Projections.Projection import _is_projection_spec -from PsyNeuLink.Components.ShellClasses import Function -from PsyNeuLink.Components.States.OutputState import OutputState -from PsyNeuLink.Components.States.ParameterState import ParameterState -from PsyNeuLink.Globals.Keywords import BACKPROPAGATION_FUNCTION, COMPARATOR_MECHANISM, HEBBIAN_FUNCTION, IDENTITY_MATRIX, LEARNING, LEARNING_MECHANISM, MATRIX, MONITOR_FOR_LEARNING, NAME, RL_FUNCTION, SAMPLE, TARGET, VARIABLE, WEIGHT -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.ObjectiveMechanisms.ComparatorMechanism import ComparatorMechanism +from psyneulink.components.component import function_type, method_type +from psyneulink.components.functions.function import BackPropagation, Hebbian, Linear, Reinforcement +from psyneulink.components.mechanisms.adaptive.learning.learningmechanism import ACTIVATION_INPUT, ACTIVATION_OUTPUT, ERROR_SIGNAL, LearningMechanism +from psyneulink.components.mechanisms.processing.objectivemechanism import ObjectiveMechanism +from psyneulink.components.mechanisms.processing.processingmechanism import ProcessingMechanism_Base +from psyneulink.components.projections.modulatory.learningprojection import LearningProjection +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.projections.projection import _is_projection_spec +from psyneulink.components.shellclasses import Function +from psyneulink.components.states.outputstate import OutputState +from psyneulink.components.states.parameterstate import ParameterState +from psyneulink.globals.keywords import BACKPROPAGATION_FUNCTION, COMPARATOR_MECHANISM, HEBBIAN_FUNCTION, IDENTITY_MATRIX, LEARNING, LEARNING_MECHANISM, MATRIX, MONITOR_FOR_LEARNING, NAME, RL_FUNCTION, SAMPLE, TARGET, VARIABLE, WEIGHT +from psyneulink.library.mechanisms.processing.objective.comparatormechanism import ComparatorMechanism class LearningAuxilliaryError(Exception): diff --git a/PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/LearningMechanism/LearningMechanism.py b/psyneulink/components/mechanisms/adaptive/learning/learningmechanism.py similarity index 97% rename from PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/LearningMechanism/LearningMechanism.py rename to psyneulink/components/mechanisms/adaptive/learning/learningmechanism.py index e8dbce3c24a..fbdda66e2de 100644 --- a/PsyNeuLink/Components/Mechanisms/AdaptiveMechanisms/LearningMechanism/LearningMechanism.py +++ b/psyneulink/components/mechanisms/adaptive/learning/learningmechanism.py @@ -520,21 +520,21 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Component import InitStatus, parameter_keywords -from PsyNeuLink.Components.Functions.Function import BackPropagation, ModulationParam, _is_modulation_param, is_function_type -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.AdaptiveMechanism import AdaptiveMechanism_Base -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ObjectiveMechanism import OUTCOME, ObjectiveMechanism -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.Projections.Projection import Projection_Base, _is_projection_spec, _validate_receiver, projection_keywords -from PsyNeuLink.Components.ShellClasses import Mechanism, Projection -from PsyNeuLink.Globals.Keywords import CONTROL_PROJECTIONS, FUNCTION_PARAMS, IDENTITY_MATRIX, INDEX, INITIALIZING, \ +from psyneulink.components.component import InitStatus, parameter_keywords +from psyneulink.components.functions.function import BackPropagation, ModulationParam, _is_modulation_param, is_function_type +from psyneulink.components.mechanisms.adaptive.adaptivemechanism import AdaptiveMechanism_Base +from psyneulink.components.mechanisms.processing.objectivemechanism import OUTCOME, ObjectiveMechanism +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.projections.projection import Projection_Base, _is_projection_spec, _validate_receiver, projection_keywords +from psyneulink.components.shellclasses import Mechanism, Projection +from psyneulink.globals.keywords import CONTROL_PROJECTIONS, FUNCTION_PARAMS, IDENTITY_MATRIX, INDEX, INITIALIZING, \ INPUT_STATES, LEARNED_PARAM, LEARNING, LEARNING_MECHANISM, LEARNING_PROJECTION, LEARNING_SIGNAL, LEARNING_SIGNALS, \ LEARNING_SIGNAL_SPECS, MAPPING_PROJECTION, MATRIX, NAME, OUTPUT_STATES, PARAMETER_STATE, PARAMS, PROJECTION, \ PROJECTIONS -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Globals.Utilities import is_numeric, parameter_spec -from PsyNeuLink.Scheduling.TimeScale import CentralClock, TimeScale +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.globals.utilities import is_numeric, parameter_spec +from psyneulink.scheduling.timescale import CentralClock, TimeScale # Params: @@ -915,10 +915,10 @@ def _validate_params(self, request_set, target_set=None, context=None): # FIX: REPLACE WITH CALL TO _parse_state_spec WITH APPROPRIATE PARAMETERS (AKIN TO CONTROL_SIGNAL) if LEARNING_SIGNALS in target_set and target_set[LEARNING_SIGNALS]: - from PsyNeuLink.Components.States.ModulatorySignals.LearningSignal \ + from psyneulink.components.states.modulatorysignals.learningsignal \ import LearningSignal - from PsyNeuLink.Components.States.ParameterState import ParameterState - from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection + from psyneulink.components.states.parameterstate import ParameterState + from psyneulink.components.projections.modulatory.learningprojection import LearningProjection for spec in target_set[LEARNING_SIGNALS]: @@ -1047,9 +1047,9 @@ def _instantiate_attributes_before_function(self, context=None): def _instantiate_output_states(self, context=None): # Create registry for LearningSignals (to manage names) - from PsyNeuLink.Globals.Registry import register_category - from PsyNeuLink.Components.States.ModulatorySignals.LearningSignal import LearningSignal - from PsyNeuLink.Components.States.State import State_Base + from psyneulink.globals.registry import register_category + from psyneulink.components.states.modulatorysignals.learningsignal import LearningSignal + from psyneulink.components.states.state import State_Base register_category(entry=LearningSignal, base_class=State_Base, registry=self._stateRegistry, @@ -1111,10 +1111,10 @@ def _instantiate_learning_signal(self, learning_signal=None, context=None): # learning_signal -> learning_signals (WITH SINGULAR ONE INDEXING INTO learning_signals.values) # FIX: THIS MAY NEED TO BE A 3d array (TO ACCOMDOATE 2d array (MATRICES) AS ENTRIES) - from PsyNeuLink.Components.States.ModulatorySignals.LearningSignal import LearningSignal - from PsyNeuLink.Components.States.State import _parse_state_spec - from PsyNeuLink.Components.States.ParameterState import ParameterState, _get_parameter_state - from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection + from psyneulink.components.states.modulatorysignals.learningsignal import LearningSignal + from psyneulink.components.states.state import _parse_state_spec + from psyneulink.components.states.parameterstate import ParameterState, _get_parameter_state + from psyneulink.components.projections.modulatory.learningprojection import LearningProjection # FIX: NEED TO CHARACTERIZE error_signal FOR BELOW # # EXTEND error_signals TO ACCOMMODATE NEW LearningSignal ------------------------------------------------- @@ -1268,9 +1268,9 @@ def _instantiate_learning_signal(self, learning_signal=None, context=None): learning_signal_name = LEARNING_SIGNAL # MODIFIED 9/22/17 END - from PsyNeuLink.Components.States.ModulatorySignals.LearningSignal \ + from psyneulink.components.states.modulatorysignals.learningsignal \ import LearningSignal - from PsyNeuLink.Components.States.State import _instantiate_state + from psyneulink.components.states.state import _instantiate_state # Get constraint for OutputState's value # - assume that LearningMechanism.value has only two items (learning_signal and error_signal) @@ -1294,7 +1294,7 @@ def _instantiate_learning_signal(self, learning_signal=None, context=None): if learning_projection: _validate_receiver(self, learning_projection, MappingProjection, LEARNING_SIGNAL, context=context) - from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection + from psyneulink.components.projections.modulatory.learningprojection import LearningProjection if not isinstance(learning_projection, LearningProjection): raise LearningMechanismError("PROGRAM ERROR: Attempt to assign {}, " "that is not a LearningProjection, to LearningSignal of {}". diff --git a/PsyNeuLink/Components/Mechanisms/Mechanism.py b/psyneulink/components/mechanisms/mechanism.py similarity index 98% rename from PsyNeuLink/Components/Mechanisms/Mechanism.py rename to psyneulink/components/mechanisms/mechanism.py index 258e8646d2a..f390cdd8498 100644 --- a/PsyNeuLink/Components/Mechanisms/Mechanism.py +++ b/psyneulink/components/mechanisms/mechanism.py @@ -634,14 +634,14 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Component import Component, ExecutionStatus, function_type, method_type -from PsyNeuLink.Components.ShellClasses import Function, Mechanism, Projection -from PsyNeuLink.Globals.Defaults import timeScaleSystemDefault -from PsyNeuLink.Globals.Keywords import CHANGED, COMMAND_LINE, DDM_MECHANISM, EVC_SIMULATION, EXECUTING, FUNCTION_PARAMS, INITIALIZING, INIT_FUNCTION_METHOD_ONLY, INIT__EXECUTE__METHOD_ONLY, INPUT_STATES, INPUT_STATE_PARAMS, MECHANISM_TIME_SCALE, MONITOR_FOR_CONTROL, MONITOR_FOR_LEARNING, NO_CONTEXT, OUTPUT_STATES, OUTPUT_STATE_PARAMS, PARAMETER_STATE, PARAMETER_STATE_PARAMS, PROCESS_INIT, SEPARATOR_BAR, SET_ATTRIBUTE, SYSTEM_INIT, TIME_SCALE, UNCHANGED, VALIDATE, kwMechanismComponentCategory, kwMechanismExecuteFunction, kwMechanismType, kwProcessDefaultMechanism -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Globals.Registry import register_category -from PsyNeuLink.Globals.Utilities import AutoNumber, ContentAddressableList, append_type_to_name, convert_to_np_array, iscompatible, kwCompatibilityNumeric -from PsyNeuLink.Scheduling.TimeScale import CentralClock, TimeScale +from psyneulink.components.component import Component, ExecutionStatus, function_type, method_type +from psyneulink.components.shellclasses import Function, Mechanism, Projection +from psyneulink.globals.defaults import timeScaleSystemDefault +from psyneulink.globals.keywords import CHANGED, COMMAND_LINE, DDM_MECHANISM, EVC_SIMULATION, EXECUTING, FUNCTION_PARAMS, INITIALIZING, INIT_FUNCTION_METHOD_ONLY, INIT__EXECUTE__METHOD_ONLY, INPUT_STATES, INPUT_STATE_PARAMS, MECHANISM_TIME_SCALE, MONITOR_FOR_CONTROL, MONITOR_FOR_LEARNING, NO_CONTEXT, OUTPUT_STATES, OUTPUT_STATE_PARAMS, PARAMETER_STATE, PARAMETER_STATE_PARAMS, PROCESS_INIT, SEPARATOR_BAR, SET_ATTRIBUTE, SYSTEM_INIT, TIME_SCALE, UNCHANGED, VALIDATE, kwMechanismComponentCategory, kwMechanismExecuteFunction, kwMechanismType, kwProcessDefaultMechanism +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.globals.registry import register_category +from psyneulink.globals.utilities import AutoNumber, ContentAddressableList, append_type_to_name, convert_to_np_array, iscompatible, kwCompatibilityNumeric +from psyneulink.scheduling.timescale import CentralClock, TimeScale logger = logging.getLogger(__name__) MechanismRegistry = {} @@ -1114,23 +1114,23 @@ def __init__(self, context=context) # Create Mechanism's _stateRegistry and state type entries - from PsyNeuLink.Components.States.State import State_Base + from psyneulink.components.states.state import State_Base self._stateRegistry = {} # InputState - from PsyNeuLink.Components.States.InputState import InputState + from psyneulink.components.states.inputstate import InputState register_category(entry=InputState, base_class=State_Base, registry=self._stateRegistry, context=context) # ParameterState - from PsyNeuLink.Components.States.ParameterState import ParameterState + from psyneulink.components.states.parameterstate import ParameterState register_category(entry=ParameterState, base_class=State_Base, registry=self._stateRegistry, context=context) # OutputState - from PsyNeuLink.Components.States.OutputState import OutputState + from psyneulink.components.states.outputstate import OutputState register_category(entry=OutputState, base_class=State_Base, registry=self._stateRegistry, @@ -1327,8 +1327,8 @@ def _validate_params(self, request_set, target_set=None, context=None): and calling on corresponding subclass to get default values (if param not found) (as PROJECTION_TYPE and PROJECTION_SENDER are currently handled) """ - from PsyNeuLink.Components.States.State import _parse_state_spec - from PsyNeuLink.Components.States.InputState import InputState + from psyneulink.components.states.state import _parse_state_spec + from psyneulink.components.states.inputstate import InputState # Perform first-pass validation in Function.__init__(): # - returns full set of params based on subclass paramClassDefaults @@ -1382,7 +1382,7 @@ def _validate_params(self, request_set, target_set=None, context=None): raise MechanismError("{0} in {1} must be a dict of param specifications". format(FUNCTION_PARAMS, self.__class__.__name__)) # Validate params - from PsyNeuLink.Components.States.ParameterState import ParameterState + from psyneulink.components.states.parameterstate import ParameterState for param_name, param_value in function_param_specs.items(): try: default_value = self.paramInstanceDefaults[FUNCTION_PARAMS][param_name] @@ -1419,7 +1419,7 @@ def _validate_params(self, request_set, target_set=None, context=None): # Validate each item in the list or OrderedDict i = 0 for key, item in param_value if isinstance(param_value, dict) else enumerate(param_value): - from PsyNeuLink.Components.States.OutputState import OutputState + from psyneulink.components.states.outputstate import OutputState # If not valid... if not ((isclass(item) and issubclass(item, OutputState)) or # OutputState class ref isinstance(item, OutputState) or # OutputState object @@ -1515,7 +1515,7 @@ def _instantiate_input_states(self, input_states=None, context=None): This is a stub, implemented to allow Mechanism subclasses to override _instantiate_input_states or process InputStates before and/or after call to _instantiate_input_states """ - from PsyNeuLink.Components.States.InputState import _instantiate_input_states + from psyneulink.components.states.inputstate import _instantiate_input_states return _instantiate_input_states(owner=self, input_states=input_states or self.input_states, context=context) def _instantiate_parameter_states(self, context=None): @@ -1525,7 +1525,7 @@ def _instantiate_parameter_states(self, context=None): or process InputStates before and/or after call to _instantiate_parameter_states """ - from PsyNeuLink.Components.States.ParameterState import _instantiate_parameter_states + from psyneulink.components.states.parameterstate import _instantiate_parameter_states _instantiate_parameter_states(owner=self, context=context) def _instantiate_output_states(self, context=None): @@ -1534,18 +1534,18 @@ def _instantiate_output_states(self, context=None): This is a stub, implemented to allow Mechanism subclasses to override _instantiate_output_states or process InputStates before and/or after call to _instantiate_output_states """ - from PsyNeuLink.Components.States.OutputState import _instantiate_output_states + from psyneulink.components.states.outputstate import _instantiate_output_states _instantiate_output_states(owner=self, output_states=self.output_states, context=context) def _add_projection_to_mechanism(self, state, projection, context=None): - from PsyNeuLink.Components.Projections.Projection import _add_projection_to + from psyneulink.components.projections.projection import _add_projection_to _add_projection_to(receiver=self, state=state, projection_spec=projection, context=context) def _add_projection_from_mechanism(self, receiver, state, projection, context=None): """Add projection to specified state """ - from PsyNeuLink.Components.Projections.Projection import _add_projection_from + from psyneulink.components.projections.projection import _add_projection_from _add_projection_from(sender=self, state=state, projection_spec=projection, receiver=receiver, context=context) def execute(self, @@ -1842,7 +1842,7 @@ def run(self, ` for each execution of the Mechanism. """ - from PsyNeuLink.Globals.Run import run + from psyneulink.globals.run import run return run(self, inputs=inputs, num_trials=num_trials, @@ -2079,9 +2079,9 @@ def add_states(self, states, context=COMMAND_LINE): specifying the class or keyword for InputState or OutputState). """ - from PsyNeuLink.Components.States.State import _parse_state_type - from PsyNeuLink.Components.States.InputState import InputState, _instantiate_input_states - from PsyNeuLink.Components.States.OutputState import OutputState, _instantiate_output_states + from psyneulink.components.states.state import _parse_state_type + from psyneulink.components.states.inputstate import InputState, _instantiate_input_states + from psyneulink.components.states.outputstate import OutputState, _instantiate_output_states # Put in list to standardize treatment below if not isinstance(states, list): @@ -2114,14 +2114,14 @@ def _get_mechanism_param_values(self): """Return dict with current value of each ParameterState in paramsCurrent :return: (dict) """ - from PsyNeuLink.Components.States.ParameterState import ParameterState + from psyneulink.components.states.parameterstate import ParameterState return dict((param, value.value) for param, value in self.paramsCurrent.items() if isinstance(value, ParameterState) ) def _get_primary_state(self, state_type): - from PsyNeuLink.Components.States.InputState import InputState - from PsyNeuLink.Components.States.ParameterState import ParameterState - from PsyNeuLink.Components.States.OutputState import OutputState + from psyneulink.components.states.inputstate import InputState + from psyneulink.components.states.parameterstate import ParameterState + from psyneulink.components.states.outputstate import OutputState if issubclass(state_type, InputState): return self.input_state if issubclass(state_type, OutputState): diff --git a/PsyNeuLink/Components/Mechanisms/__init__.py b/psyneulink/components/mechanisms/processing/__init__.py similarity index 100% rename from PsyNeuLink/Components/Mechanisms/__init__.py rename to psyneulink/components/mechanisms/processing/__init__.py diff --git a/PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/CompositionInterfaceMechanism.py b/psyneulink/components/mechanisms/processing/compositioninterfacemechanism.py similarity index 93% rename from PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/CompositionInterfaceMechanism.py rename to psyneulink/components/mechanisms/processing/compositioninterfacemechanism.py index 730e6382342..404c513591b 100644 --- a/PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/CompositionInterfaceMechanism.py +++ b/psyneulink/components/mechanisms/processing/compositioninterfacemechanism.py @@ -46,13 +46,13 @@ import typecheck as tc -from PsyNeuLink.Components.Functions.Function import Linear -from PsyNeuLink.Components.Mechanisms.Mechanism import Mechanism_Base -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ProcessingMechanism import ProcessingMechanism_Base -from PsyNeuLink.Globals.Keywords import COMPOSITION_INTERFACE_MECHANISM, kwPreferenceSetName -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set, kpReportOutputPref -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceEntry, PreferenceLevel -from PsyNeuLink.Scheduling.TimeScale import TimeScale +from psyneulink.components.functions.function import Linear +from psyneulink.components.mechanisms.mechanism import Mechanism_Base +from psyneulink.components.mechanisms.processing.processingmechanism import ProcessingMechanism_Base +from psyneulink.globals.keywords import COMPOSITION_INTERFACE_MECHANISM, kwPreferenceSetName +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set, kpReportOutputPref +from psyneulink.globals.preferences.preferenceset import PreferenceEntry, PreferenceLevel +from psyneulink.scheduling.timescale import TimeScale class CompositionInterfaceMechanism(ProcessingMechanism_Base): diff --git a/PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/DefaultProcessingMechanism.py b/psyneulink/components/mechanisms/processing/defaultprocessingmechanism.py similarity index 90% rename from PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/DefaultProcessingMechanism.py rename to psyneulink/components/mechanisms/processing/defaultprocessingmechanism.py index 95fe62342ef..1750f73bae0 100644 --- a/PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/DefaultProcessingMechanism.py +++ b/psyneulink/components/mechanisms/processing/defaultprocessingmechanism.py @@ -14,11 +14,11 @@ """ import typecheck as tc -from PsyNeuLink.Components.Mechanisms.Mechanism import Mechanism_Base -from PsyNeuLink.Globals.Defaults import SystemDefaultInputValue -from PsyNeuLink.Globals.Keywords import DEFAULT_PROCESSING_MECHANISM, FUNCTION, FUNCTION_PARAMS, INTERCEPT, SLOPE -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel +from psyneulink.components.mechanisms.mechanism import Mechanism_Base +from psyneulink.globals.defaults import SystemDefaultInputValue +from psyneulink.globals.keywords import DEFAULT_PROCESSING_MECHANISM, FUNCTION, FUNCTION_PARAMS, INTERCEPT, SLOPE +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel # **************************************** DefaultProcessingMechanism ****************************************************** @@ -55,7 +55,7 @@ class DefaultProcessingMechanism_Base(Mechanism_Base): class ClassDefaults(Mechanism_Base.ClassDefaults): variable = SystemDefaultInputValue - from PsyNeuLink.Components.Functions.Function import Linear + from psyneulink.components.functions.function import Linear paramClassDefaults = Mechanism_Base.paramClassDefaults.copy() paramClassDefaults.update({ FUNCTION:Linear, diff --git a/PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/IntegratorMechanism.py b/psyneulink/components/mechanisms/processing/integratormechanism.py similarity index 96% rename from PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/IntegratorMechanism.py rename to psyneulink/components/mechanisms/processing/integratormechanism.py index b6e2a1dbd56..ad3848c8172 100644 --- a/PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/IntegratorMechanism.py +++ b/psyneulink/components/mechanisms/processing/integratormechanism.py @@ -68,11 +68,11 @@ """ import typecheck as tc -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ProcessingMechanism import ProcessingMechanism_Base -from PsyNeuLink.Globals.Keywords import INTEGRATOR_MECHANISM, OUTPUT_STATES, PREDICTION_MECHANISM_OUTPUT, kwPreferenceSetName -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set, kpReportOutputPref -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceEntry, PreferenceLevel -from PsyNeuLink.Scheduling.TimeScale import TimeScale +from psyneulink.components.mechanisms.processing.processingmechanism import ProcessingMechanism_Base +from psyneulink.globals.keywords import INTEGRATOR_MECHANISM, OUTPUT_STATES, PREDICTION_MECHANISM_OUTPUT, kwPreferenceSetName +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set, kpReportOutputPref +from psyneulink.globals.preferences.preferenceset import PreferenceEntry, PreferenceLevel +from psyneulink.scheduling.timescale import TimeScale # IntegratorMechanism parameter keywords: DEFAULT_RATE = 0.5 @@ -190,7 +190,7 @@ class ClassDefaults(ProcessingMechanism_Base.ClassDefaults): }) - from PsyNeuLink.Components.Functions.Function import AdaptiveIntegrator + from psyneulink.components.functions.function import AdaptiveIntegrator @tc.typecheck def __init__(self, diff --git a/PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/ObjectiveMechanism.py b/psyneulink/components/mechanisms/processing/objectivemechanism.py similarity index 98% rename from PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/ObjectiveMechanism.py rename to psyneulink/components/mechanisms/processing/objectivemechanism.py index 22e379a175d..1338deadc24 100644 --- a/PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/ObjectiveMechanism.py +++ b/psyneulink/components/mechanisms/processing/objectivemechanism.py @@ -330,19 +330,19 @@ import typecheck as tc -from PsyNeuLink.Components.Component import InitStatus -from PsyNeuLink.Components.Functions.Function import LinearCombination -from PsyNeuLink.Components.Mechanisms.Mechanism import Mechanism_Base, MonitoredOutputStatesOption -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ProcessingMechanism import ProcessingMechanism_Base -from PsyNeuLink.Components.ShellClasses import Mechanism, State -from PsyNeuLink.Components.States.InputState import InputState -from PsyNeuLink.Components.States.OutputState import OutputState, PRIMARY_OUTPUT_STATE, standard_output_states -from PsyNeuLink.Components.States.State import _parse_state_spec -from PsyNeuLink.Globals.Keywords import AUTO_ASSIGN_MATRIX, CONTROL, DEFAULT_MATRIX, EXPONENT, EXPONENTS, FUNCTION, INPUT_STATES, LEARNING, MATRIX, MECHANISM, NAME, OBJECTIVE_MECHANISM, OUTPUT_STATE, OUTPUT_STATES, PARAMS, PROJECTIONS, SENDER, TIME_SCALE, VALUE, VARIABLE, WEIGHT, WEIGHTS, kwPreferenceSetName -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set, kpReportOutputPref -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceEntry, PreferenceLevel -from PsyNeuLink.Globals.Utilities import ContentAddressableList, is_matrix -from PsyNeuLink.Scheduling.TimeScale import TimeScale +from psyneulink.components.component import InitStatus +from psyneulink.components.functions.function import LinearCombination +from psyneulink.components.mechanisms.mechanism import Mechanism_Base, MonitoredOutputStatesOption +from psyneulink.components.mechanisms.processing.processingmechanism import ProcessingMechanism_Base +from psyneulink.components.shellclasses import Mechanism, State +from psyneulink.components.states.inputstate import InputState +from psyneulink.components.states.outputstate import OutputState, PRIMARY_OUTPUT_STATE, standard_output_states +from psyneulink.components.states.state import _parse_state_spec +from psyneulink.globals.keywords import AUTO_ASSIGN_MATRIX, CONTROL, DEFAULT_MATRIX, EXPONENT, EXPONENTS, FUNCTION, INPUT_STATES, LEARNING, MATRIX, MECHANISM, NAME, OBJECTIVE_MECHANISM, OUTPUT_STATE, OUTPUT_STATES, PARAMS, PROJECTIONS, SENDER, TIME_SCALE, VALUE, VARIABLE, WEIGHT, WEIGHTS, kwPreferenceSetName +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set, kpReportOutputPref +from psyneulink.globals.preferences.preferenceset import PreferenceEntry, PreferenceLevel +from psyneulink.globals.utilities import ContentAddressableList, is_matrix +from psyneulink.scheduling.timescale import TimeScale ROLE = 'role' MONITORED_OUTPUT_STATES = 'monitored_output_states' @@ -572,7 +572,7 @@ def __init__(self, params=params) self._learning_role = None - from PsyNeuLink.Components.States.OutputState import StandardOutputStates + from psyneulink.components.states.outputstate import StandardOutputStates if not isinstance(self.standard_output_states, StandardOutputStates): self.standard_output_states = StandardOutputStates(self, self.standard_output_states, @@ -983,7 +983,7 @@ def _parse_monitored_output_states(source, output_state_list, mech=None, context output_state = output_state_tuple.output_state # If output_state is a string, - from PsyNeuLink.Components.ShellClasses import System + from psyneulink.components.shellclasses import System if isinstance(output_state, str): if not isinstance(source, System): raise ObjectiveMechanismError("A string was used to specify an OutputState (presumably its name: " @@ -1104,8 +1104,8 @@ def _instantiate_monitoring_projections(owner, receiver_projection_specs:tc.optional(list)=None, context=None): - from PsyNeuLink.Components.States.OutputState import OutputState - from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection + from psyneulink.components.states.outputstate import OutputState + from psyneulink.components.projections.pathway.mappingprojection import MappingProjection receiver_projection_specs = receiver_projection_specs or [DEFAULT_MATRIX] * len(sender_list) diff --git a/PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/ProcessingMechanism.py b/psyneulink/components/mechanisms/processing/processingmechanism.py similarity index 96% rename from PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/ProcessingMechanism.py rename to psyneulink/components/mechanisms/processing/processingmechanism.py index 9cf59b3383d..9a9f31a5490 100644 --- a/PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/ProcessingMechanism.py +++ b/psyneulink/components/mechanisms/processing/processingmechanism.py @@ -49,9 +49,9 @@ """ -from PsyNeuLink.Components.Mechanisms.Mechanism import Mechanism_Base -from PsyNeuLink.Globals.Defaults import defaultControlAllocation -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel +from psyneulink.components.mechanisms.mechanism import Mechanism_Base +from psyneulink.globals.defaults import defaultControlAllocation +from psyneulink.globals.preferences.preferenceset import PreferenceLevel # ControlMechanismRegistry = {} diff --git a/PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/TransferMechanism.py b/psyneulink/components/mechanisms/processing/transfermechanism.py similarity index 97% rename from PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/TransferMechanism.py rename to psyneulink/components/mechanisms/processing/transfermechanism.py index fb41c251d59..dc8b7a72ded 100644 --- a/PsyNeuLink/Components/Mechanisms/ProcessingMechanisms/TransferMechanism.py +++ b/psyneulink/components/mechanisms/processing/transfermechanism.py @@ -116,16 +116,16 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Component import Component, function_type, method_type -from PsyNeuLink.Components.Functions.Function import AdaptiveIntegrator, Linear -from PsyNeuLink.Components.Mechanisms.Mechanism import MechanismError -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ProcessingMechanism import ProcessingMechanism_Base -from PsyNeuLink.Components.States.OutputState import PRIMARY_OUTPUT_STATE, StandardOutputStates, standard_output_states -from PsyNeuLink.Globals.Keywords import FUNCTION, INITIALIZER, INITIALIZING, MEAN, MEDIAN, NOISE, RATE, RESULT, STANDARD_DEVIATION, TRANSFER_FUNCTION_TYPE, TRANSFER_MECHANISM, VARIANCE, kwPreferenceSetName -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set, kpReportOutputPref, kpRuntimeParamStickyAssignmentPref -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceEntry, PreferenceLevel -from PsyNeuLink.Globals.Utilities import append_type_to_name, iscompatible -from PsyNeuLink.Scheduling.TimeScale import CentralClock, TimeScale +from psyneulink.components.component import Component, function_type, method_type +from psyneulink.components.functions.function import AdaptiveIntegrator, Linear +from psyneulink.components.mechanisms.mechanism import MechanismError +from psyneulink.components.mechanisms.processing.processingmechanism import ProcessingMechanism_Base +from psyneulink.components.states.outputstate import PRIMARY_OUTPUT_STATE, StandardOutputStates, standard_output_states +from psyneulink.globals.keywords import FUNCTION, INITIALIZER, INITIALIZING, MEAN, MEDIAN, NOISE, RATE, RESULT, STANDARD_DEVIATION, TRANSFER_FUNCTION_TYPE, TRANSFER_MECHANISM, VARIANCE, kwPreferenceSetName +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set, kpReportOutputPref, kpRuntimeParamStickyAssignmentPref +from psyneulink.globals.preferences.preferenceset import PreferenceEntry, PreferenceLevel +from psyneulink.globals.utilities import append_type_to_name, iscompatible +from psyneulink.scheduling.timescale import CentralClock, TimeScale # TransferMechanism parameter keywords: RANGE = "range" @@ -594,7 +594,7 @@ def _try_execute_param(self, param, var): def _instantiate_parameter_states(self, context=None): - from PsyNeuLink.Components.Functions.Function import Logistic + from psyneulink.components.functions.function import Logistic # If function is a logistic, and range has not been specified, bound it between 0 and 1 if ((isinstance(self.function, Logistic) or (inspect.isclass(self.function) and issubclass(self.function,Logistic))) and diff --git a/PsyNeuLink/Components/Process.py b/psyneulink/components/process.py similarity index 98% rename from PsyNeuLink/Components/Process.py rename to psyneulink/components/process.py index 3475abc4127..ff18089fc8a 100644 --- a/PsyNeuLink/Components/Process.py +++ b/psyneulink/components/process.py @@ -450,24 +450,24 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Component import Component, ExecutionStatus, InitStatus, function_type -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.ControlMechanism.ControlMechanism import ControlMechanism -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.LearningMechanism.LearningMechanism import LearningMechanism -from PsyNeuLink.Components.Mechanisms.Mechanism import MechanismList, Mechanism_Base -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ObjectiveMechanism import ObjectiveMechanism -from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection, _is_learning_spec -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.Projections.Projection import _add_projection_to, _is_projection_spec -from PsyNeuLink.Components.ShellClasses import Mechanism, Process, Projection, System -from PsyNeuLink.Components.States.ModulatorySignals.LearningSignal import LearningSignal -from PsyNeuLink.Components.States.ParameterState import ParameterState -from PsyNeuLink.Components.States.State import _instantiate_state, _instantiate_state_list -from PsyNeuLink.Globals.Keywords import AUTO_ASSIGN_MATRIX, COMPONENT_INIT, ENABLED, EXECUTING, FUNCTION, FUNCTION_PARAMS, HARD_CLAMP, INITIALIZING, INITIAL_VALUES, INTERNAL, LEARNING, LEARNING_PROJECTION, MAPPING_PROJECTION, MATRIX, NAME, OBJECTIVE_MECHANISM, ORIGIN, PARAMETER_STATE, PATHWAY, PROCESS, PROCESS_INIT, SENDER, SEPARATOR_BAR, SINGLETON, SOFT_CLAMP, TARGET, TERMINAL, TIME_SCALE, kwProcessComponentCategory, kwReceiverArg, kwSeparator -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Globals.Registry import register_category -from PsyNeuLink.Globals.Utilities import append_type_to_name, convert_to_np_array, iscompatible, parameter_spec -from PsyNeuLink.Scheduling.TimeScale import CentralClock, TimeScale +from psyneulink.components.component import Component, ExecutionStatus, InitStatus, function_type +from psyneulink.components.mechanisms.adaptive.control.controlmechanism import ControlMechanism +from psyneulink.components.mechanisms.adaptive.learning.learningmechanism import LearningMechanism +from psyneulink.components.mechanisms.mechanism import MechanismList, Mechanism_Base +from psyneulink.components.mechanisms.processing.objectivemechanism import ObjectiveMechanism +from psyneulink.components.projections.modulatory.learningprojection import LearningProjection, _is_learning_spec +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.projections.projection import _add_projection_to, _is_projection_spec +from psyneulink.components.shellclasses import Mechanism, Process, Projection, System +from psyneulink.components.states.modulatorysignals.learningsignal import LearningSignal +from psyneulink.components.states.parameterstate import ParameterState +from psyneulink.components.states.state import _instantiate_state, _instantiate_state_list +from psyneulink.globals.keywords import AUTO_ASSIGN_MATRIX, COMPONENT_INIT, ENABLED, EXECUTING, FUNCTION, FUNCTION_PARAMS, HARD_CLAMP, INITIALIZING, INITIAL_VALUES, INTERNAL, LEARNING, LEARNING_PROJECTION, MAPPING_PROJECTION, MATRIX, NAME, OBJECTIVE_MECHANISM, ORIGIN, PARAMETER_STATE, PATHWAY, PROCESS, PROCESS_INIT, SENDER, SEPARATOR_BAR, SINGLETON, SOFT_CLAMP, TARGET, TERMINAL, TIME_SCALE, kwProcessComponentCategory, kwReceiverArg, kwSeparator +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.globals.registry import register_category +from psyneulink.globals.utilities import append_type_to_name, convert_to_np_array, iscompatible, parameter_spec +from psyneulink.scheduling.timescale import CentralClock, TimeScale # ***************************************** PROCESS CLASS ******************************************************** @@ -665,7 +665,7 @@ def process(process_spec=None, kwProcessInputState = 'ProcessInputState' kwTarget = 'target' -from PsyNeuLink.Components.States.OutputState import OutputState +from psyneulink.components.states.outputstate import OutputState # DOCUMENT: HOW DO MULTIPLE PROCESS INPUTS RELATE TO # OF INPUTSTATES IN FIRST MECHANISM # WHAT HAPPENS IF LENGTH OF INPUT TO PROCESS DOESN'T MATCH LENGTH OF VARIABLE FOR FIRST MECHANISM?? @@ -1215,7 +1215,7 @@ def _instantiate_pathway(self, context): def _standardize_config_entries(self, pathway, context=None): - from PsyNeuLink.Components.Mechanisms.Mechanism import _is_mechanism_spec + from psyneulink.components.mechanisms.mechanism import _is_mechanism_spec # FIX: SHOULD MOVE VALIDATION COMPONENTS BELOW TO Process._validate_params self.runtime_params_dict = {} @@ -1873,7 +1873,7 @@ def _assign_process_input_projections(self, mechanism, context=None): prefs=self.prefs) self.process_input_states.append(process_input_state) - from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection + from psyneulink.components.projections.pathway.mappingprojection import MappingProjection # If there is the same number of Process input values and mechanism.input_states, assign one to each if num_process_inputs == num_mechanism_input_states: @@ -2007,7 +2007,7 @@ def _instantiate__deferred_inits(self, context=None): # MODIFIED 5/2/17 NEW: # Defer instantiation of ControlProjections to System # and there should not be any other type of Projection to the ParameterState of a Mechanism - from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection + from psyneulink.components.projections.modulatory.controlprojection import ControlProjection if not all(isinstance(proj, ControlProjection) for proj in parameter_state.mod_afferents): raise ProcessError("PROGRAM ERROR: non-ControlProjection found to ParameterState for a Mechanism") # MODIFIED 5/2/17 END @@ -2105,8 +2105,8 @@ def _check_for_target_mechanisms(self): and report assignment if verbose """ - from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ObjectiveMechanism import ObjectiveMechanism - from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.LearningMechanism.LearningMechanism \ + from psyneulink.components.mechanisms.processing.objectivemechanism import ObjectiveMechanism + from psyneulink.components.mechanisms.adaptive.learning.learningmechanism \ import ACTIVATION_INPUT def trace_learning_objective_mechanism_projections(mech): """Recursively trace projections to Objective mechanisms; @@ -2216,7 +2216,7 @@ def _instantiate_target_input(self, context=None): self.target_input_states.append(target_input_state) # Add MappingProjection from target_input_state to ComparatorMechanism's TARGET InputState - from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection + from psyneulink.components.projections.pathway.mappingprojection import MappingProjection MappingProjection(sender=target_input_state, receiver=target_mech_target, name=self.name+'_Input Projection to '+target_mech_target.name) @@ -2310,7 +2310,7 @@ def execute(self, context = EXECUTING + " " + PROCESS + " " + self.name self.execution_status = ExecutionStatus.EXECUTING - from PsyNeuLink.Globals.Run import _get_unique_id + from psyneulink.globals.run import _get_unique_id self._execution_id = execution_id or _get_unique_id() for mech in self.mechanisms: mech._execution_id = self._execution_id @@ -2556,7 +2556,7 @@ def run(self, if initial_values is None and self.initial_values: initial_values = self.initial_values - from PsyNeuLink.Globals.Run import run + from psyneulink.globals.run import run return run(self, inputs=inputs, num_trials=num_trials, @@ -2615,7 +2615,7 @@ def _report_process_completion(self, separator=False): re.sub(r'[\[,\],\n]','',str([float("{:0.3}".format(float(i))) for i in self.output_state.value])))) if self.learning: - from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.ObjectiveMechanisms.ComparatorMechanism import MSE + from psyneulink.library.mechanisms.processing.objective.comparatormechanism import MSE for mech in self.target_mechanisms: if not MSE in mech.output_states: continue diff --git a/PsyNeuLink/Components/Projections/ModulatoryProjections/__init__.py b/psyneulink/components/projections/__init__.py similarity index 100% rename from PsyNeuLink/Components/Projections/ModulatoryProjections/__init__.py rename to psyneulink/components/projections/__init__.py diff --git a/PsyNeuLink/Components/Projections/PathwayProjections/__init__.py b/psyneulink/components/projections/modulatory/__init__.py similarity index 100% rename from PsyNeuLink/Components/Projections/PathwayProjections/__init__.py rename to psyneulink/components/projections/modulatory/__init__.py diff --git a/PsyNeuLink/Components/Projections/ModulatoryProjections/ControlProjection.py b/psyneulink/components/projections/modulatory/controlprojection.py similarity index 95% rename from PsyNeuLink/Components/Projections/ModulatoryProjections/ControlProjection.py rename to psyneulink/components/projections/modulatory/controlprojection.py index d484470846a..ccaed16ca98 100644 --- a/PsyNeuLink/Components/Projections/ModulatoryProjections/ControlProjection.py +++ b/psyneulink/components/projections/modulatory/controlprojection.py @@ -99,17 +99,17 @@ import typecheck as tc -from PsyNeuLink.Components.Component import InitStatus, parameter_keywords -from PsyNeuLink.Components.Functions.Function import Linear -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.ControlMechanism.ControlMechanism import ControlMechanism -from PsyNeuLink.Components.Projections.ModulatoryProjections.ModulatoryProjection import ModulatoryProjection_Base -from PsyNeuLink.Components.Projections.Projection import ProjectionError, Projection_Base, projection_keywords -from PsyNeuLink.Components.ShellClasses import Mechanism, Process -from PsyNeuLink.Globals.Defaults import defaultControlAllocation -from PsyNeuLink.Globals.Keywords import CONTROL, CONTROL_PROJECTION, PROJECTION_SENDER, PROJECTION_SENDER_VALUE -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Scheduling.TimeScale import CentralClock +from psyneulink.components.component import InitStatus, parameter_keywords +from psyneulink.components.functions.function import Linear +from psyneulink.components.mechanisms.adaptive.control.controlmechanism import ControlMechanism +from psyneulink.components.projections.modulatory.modulatoryprojection import ModulatoryProjection_Base +from psyneulink.components.projections.projection import ProjectionError, Projection_Base, projection_keywords +from psyneulink.components.shellclasses import Mechanism, Process +from psyneulink.globals.defaults import defaultControlAllocation +from psyneulink.globals.keywords import CONTROL, CONTROL_PROJECTION, PROJECTION_SENDER, PROJECTION_SENDER_VALUE +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.scheduling.timescale import CentralClock parameter_keywords.update({CONTROL_PROJECTION, CONTROL}) projection_keywords.update({CONTROL_PROJECTION, CONTROL}) @@ -343,7 +343,7 @@ def _instantiate_receiver(self, context=None): if isinstance(self.receiver, Mechanism): # If there is just one param of ParameterState type in the receiver Mechanism # then assign it as actual receiver (which must be a State); otherwise, raise exception - from PsyNeuLink.Components.States.ParameterState import ParameterState + from psyneulink.components.states.parameterstate import ParameterState if len(dict((param_name, state) for param_name, state in self.receiver.paramsCurrent.items() if isinstance(state, ParameterState))) == 1: receiver_parameter_state = [state for state in dict.values()][0] diff --git a/PsyNeuLink/Components/Projections/ModulatoryProjections/GatingProjection.py b/psyneulink/components/projections/modulatory/gatingprojection.py similarity index 94% rename from PsyNeuLink/Components/Projections/ModulatoryProjections/GatingProjection.py rename to psyneulink/components/projections/modulatory/gatingprojection.py index 6f8d9e642cf..2893b3e420d 100644 --- a/PsyNeuLink/Components/Projections/ModulatoryProjections/GatingProjection.py +++ b/psyneulink/components/projections/modulatory/gatingprojection.py @@ -89,17 +89,17 @@ """ import typecheck as tc -from PsyNeuLink.Components.Component import InitStatus, parameter_keywords -from PsyNeuLink.Components.Functions.Function import FunctionOutputType, Linear -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.GatingMechanism.GatingMechanism import GatingMechanism -from PsyNeuLink.Components.Projections.ModulatoryProjections.ModulatoryProjection import ModulatoryProjection_Base -from PsyNeuLink.Components.Projections.Projection import ProjectionError, Projection_Base, projection_keywords -from PsyNeuLink.Components.ShellClasses import Mechanism, Process -from PsyNeuLink.Globals.Defaults import defaultGatingPolicy -from PsyNeuLink.Globals.Keywords import FUNCTION_OUTPUT_TYPE, GATING, GATING_MECHANISM, GATING_PROJECTION, INITIALIZING, PROJECTION_SENDER, PROJECTION_SENDER_VALUE -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Scheduling.TimeScale import CentralClock +from psyneulink.components.component import InitStatus, parameter_keywords +from psyneulink.components.functions.function import FunctionOutputType, Linear +from psyneulink.components.mechanisms.adaptive.gating.gatingmechanism import GatingMechanism +from psyneulink.components.projections.modulatory.modulatoryprojection import ModulatoryProjection_Base +from psyneulink.components.projections.projection import ProjectionError, Projection_Base, projection_keywords +from psyneulink.components.shellclasses import Mechanism, Process +from psyneulink.globals.defaults import defaultGatingPolicy +from psyneulink.globals.keywords import FUNCTION_OUTPUT_TYPE, GATING, GATING_MECHANISM, GATING_PROJECTION, INITIALIZING, PROJECTION_SENDER, PROJECTION_SENDER_VALUE +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.scheduling.timescale import CentralClock parameter_keywords.update({GATING_PROJECTION, GATING}) projection_keywords.update({GATING_PROJECTION, GATING}) @@ -298,8 +298,8 @@ def _validate_params(self, request_set, target_set=None, context=None): super()._validate_params(request_set=request_set, target_set=target_set, context=context) if INITIALIZING in context: - from PsyNeuLink.Components.States.InputState import InputState - from PsyNeuLink.Components.States.OutputState import OutputState + from psyneulink.components.states.inputstate import InputState + from psyneulink.components.states.outputstate import OutputState if not isinstance(self.receiver, (InputState, OutputState, Mechanism)): raise GatingProjectionError("Receiver specified for {} {} is not a " "Mechanism, InputState or OutputState". diff --git a/PsyNeuLink/Components/Projections/ModulatoryProjections/LearningProjection.py b/psyneulink/components/projections/modulatory/learningprojection.py similarity index 96% rename from PsyNeuLink/Components/Projections/ModulatoryProjections/LearningProjection.py rename to psyneulink/components/projections/modulatory/learningprojection.py index 649fdad5997..d204cee57fc 100644 --- a/PsyNeuLink/Components/Projections/ModulatoryProjections/LearningProjection.py +++ b/psyneulink/components/projections/modulatory/learningprojection.py @@ -145,21 +145,21 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Component import InitStatus, parameter_keywords -from PsyNeuLink.Components.Functions.Function import BackPropagation, Linear, is_function_type -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.LearningMechanism.LearningMechanism import ERROR_SIGNAL, LearningMechanism -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ObjectiveMechanism import ObjectiveMechanism -from PsyNeuLink.Components.Projections.ModulatoryProjections.ModulatoryProjection import ModulatoryProjection_Base -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.Projections.Projection import Projection_Base, _is_projection_spec, projection_keywords -from PsyNeuLink.Components.States.ModulatorySignals.LearningSignal import LearningSignal -from PsyNeuLink.Components.States.OutputState import OutputState -from PsyNeuLink.Components.States.ParameterState import ParameterState -from PsyNeuLink.Globals.Keywords import ENABLED, FUNCTION, FUNCTION_PARAMS, INITIALIZING, INTERCEPT, LEARNING, LEARNING_PROJECTION, MATRIX, PARAMETER_STATES, PROJECTION_SENDER, SLOPE -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Globals.Utilities import iscompatible, parameter_spec -from PsyNeuLink.Scheduling.TimeScale import CentralClock +from psyneulink.components.component import InitStatus, parameter_keywords +from psyneulink.components.functions.function import BackPropagation, Linear, is_function_type +from psyneulink.components.mechanisms.adaptive.learning.learningmechanism import ERROR_SIGNAL, LearningMechanism +from psyneulink.components.mechanisms.processing.objectivemechanism import ObjectiveMechanism +from psyneulink.components.projections.modulatory.modulatoryprojection import ModulatoryProjection_Base +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.projections.projection import Projection_Base, _is_projection_spec, projection_keywords +from psyneulink.components.states.modulatorysignals.learningsignal import LearningSignal +from psyneulink.components.states.outputstate import OutputState +from psyneulink.components.states.parameterstate import ParameterState +from psyneulink.globals.keywords import ENABLED, FUNCTION, FUNCTION_PARAMS, INITIALIZING, INTERCEPT, LEARNING, LEARNING_PROJECTION, MATRIX, PARAMETER_STATES, PROJECTION_SENDER, SLOPE +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.globals.utilities import iscompatible, parameter_spec +from psyneulink.scheduling.timescale import CentralClock # Params: @@ -466,7 +466,7 @@ def _instantiate_sender(self, context=None): # so call composition for "automatic" instantiation of a LearningMechanism # Note: this also instantiates an ObjectiveMechanism if necessary and assigns it the necessary projections if not isinstance(self.sender, (OutputState, LearningMechanism)): - from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.LearningMechanism.LearningAuxilliary \ + from psyneulink.components.mechanisms.adaptive.learning.learningauxilliary \ import _instantiate_learning_components _instantiate_learning_components(learning_projection=self, context=context + " " + self.name) diff --git a/PsyNeuLink/Components/Projections/ModulatoryProjections/ModulatoryProjection.py b/psyneulink/components/projections/modulatory/modulatoryprojection.py similarity index 98% rename from PsyNeuLink/Components/Projections/ModulatoryProjections/ModulatoryProjection.py rename to psyneulink/components/projections/modulatory/modulatoryprojection.py index bc4577ad9d6..30ed7bf0efc 100644 --- a/PsyNeuLink/Components/Projections/ModulatoryProjections/ModulatoryProjection.py +++ b/psyneulink/components/projections/modulatory/modulatoryprojection.py @@ -80,8 +80,8 @@ """ -from PsyNeuLink.Components.Projections.Projection import Projection_Base -from PsyNeuLink.Globals.Keywords import MODULATORY_PROJECTION +from psyneulink.components.projections.projection import Projection_Base +from psyneulink.globals.keywords import MODULATORY_PROJECTION MODULATORY_SIGNAL_PARAMS = 'modulatory_signal_params' diff --git a/PsyNeuLink/Components/Projections/__init__.py b/psyneulink/components/projections/pathway/__init__.py similarity index 100% rename from PsyNeuLink/Components/Projections/__init__.py rename to psyneulink/components/projections/pathway/__init__.py diff --git a/PsyNeuLink/Components/Projections/PathwayProjections/MappingProjection.py b/psyneulink/components/projections/pathway/mappingprojection.py similarity index 98% rename from PsyNeuLink/Components/Projections/PathwayProjections/MappingProjection.py rename to psyneulink/components/projections/pathway/mappingprojection.py index 2416d9be4e7..fb35e1ed19a 100644 --- a/PsyNeuLink/Components/Projections/PathwayProjections/MappingProjection.py +++ b/psyneulink/components/projections/pathway/mappingprojection.py @@ -232,14 +232,14 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Component import InitStatus, parameter_keywords -from PsyNeuLink.Components.Functions.Function import AccumulatorIntegrator, LinearMatrix, get_matrix -from PsyNeuLink.Components.Projections.PathwayProjections.PathwayProjection import PathwayProjection_Base -from PsyNeuLink.Components.Projections.Projection import ProjectionError, Projection_Base, projection_keywords -from PsyNeuLink.Globals.Keywords import AUTO_ASSIGN_MATRIX, CHANGED, DEFAULT_MATRIX, FULL_CONNECTIVITY_MATRIX, FUNCTION, FUNCTION_PARAMS, HOLLOW_MATRIX, IDENTITY_MATRIX, LEARNING, LEARNING_PROJECTION, MAPPING_PROJECTION, MATRIX, OUTPUT_STATE, PROJECTION_SENDER, PROJECTION_SENDER_VALUE -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceEntry, PreferenceLevel -from PsyNeuLink.Scheduling.TimeScale import CentralClock +from psyneulink.components.component import InitStatus, parameter_keywords +from psyneulink.components.functions.function import AccumulatorIntegrator, LinearMatrix, get_matrix +from psyneulink.components.projections.pathway.pathwayprojection import PathwayProjection_Base +from psyneulink.components.projections.projection import ProjectionError, Projection_Base, projection_keywords +from psyneulink.globals.keywords import AUTO_ASSIGN_MATRIX, CHANGED, DEFAULT_MATRIX, FULL_CONNECTIVITY_MATRIX, FUNCTION, FUNCTION_PARAMS, HOLLOW_MATRIX, IDENTITY_MATRIX, LEARNING, LEARNING_PROJECTION, MAPPING_PROJECTION, MATRIX, OUTPUT_STATE, PROJECTION_SENDER, PROJECTION_SENDER_VALUE +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceEntry, PreferenceLevel +from psyneulink.scheduling.timescale import CentralClock parameter_keywords.update({MAPPING_PROJECTION}) projection_keywords.update({MAPPING_PROJECTION}) @@ -632,7 +632,7 @@ def _matrix_spec(self, value): # Specification is a two-item tuple, so validate that 2nd item is: # *LEARNING* or *LEARNING_PROJECTION* keyword, LearningProjection subclass, or instance of a LearningPojection - from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection + from psyneulink.components.projections.modulatory.learningprojection import LearningProjection if (isinstance(self.paramsCurrent[FUNCTION_PARAMS][MATRIX], tuple) and len(self.paramsCurrent[FUNCTION_PARAMS][MATRIX]) is 2 and (self.paramsCurrent[FUNCTION_PARAMS][MATRIX][1] in {LEARNING, LEARNING_PROJECTION} diff --git a/PsyNeuLink/Components/Projections/PathwayProjections/PathwayProjection.py b/psyneulink/components/projections/pathway/pathwayprojection.py similarity index 95% rename from PsyNeuLink/Components/Projections/PathwayProjections/PathwayProjection.py rename to psyneulink/components/projections/pathway/pathwayprojection.py index f87707b5101..6bfad9c53a4 100644 --- a/PsyNeuLink/Components/Projections/PathwayProjections/PathwayProjection.py +++ b/psyneulink/components/projections/pathway/pathwayprojection.py @@ -44,8 +44,8 @@ """ -from PsyNeuLink.Components.Projections.Projection import Projection_Base -from PsyNeuLink.Globals.Keywords import PATHWAY_PROJECTION +from psyneulink.components.projections.projection import Projection_Base +from psyneulink.globals.keywords import PATHWAY_PROJECTION class PathwayProjection_Base(Projection_Base): """Subclass of `Projection ` that projects from an `OutputState` to an `InputState` diff --git a/PsyNeuLink/Components/Projections/Projection.py b/psyneulink/components/projections/projection.py similarity index 98% rename from PsyNeuLink/Components/Projections/Projection.py rename to psyneulink/components/projections/projection.py index 0518ba2412a..89a934506cc 100644 --- a/PsyNeuLink/Components/Projections/Projection.py +++ b/psyneulink/components/projections/projection.py @@ -295,12 +295,12 @@ import typecheck as tc import warnings -from PsyNeuLink.Components.Component import Component, InitStatus -from PsyNeuLink.Components.ShellClasses import Mechanism, Process, Projection, State -from PsyNeuLink.Globals.Keywords import CONTROL, CONTROL_PROJECTION, GATING, GATING_PROJECTION, INPUT_STATE, LEARNING, LEARNING_PROJECTION, MAPPING_PROJECTION, MATRIX_KEYWORD_SET, MECHANISM, OUTPUT_STATE, PARAMETER_STATE_PARAMS, PROJECTION, PROJECTION_SENDER, PROJECTION_TYPE, kwAddInputState, kwAddOutputState, kwProjectionComponentCategory -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Globals.Registry import register_category -from PsyNeuLink.Globals.Utilities import ContentAddressableList, iscompatible, type_match +from psyneulink.components.component import Component, InitStatus +from psyneulink.components.shellclasses import Mechanism, Process, Projection, State +from psyneulink.globals.keywords import CONTROL, CONTROL_PROJECTION, GATING, GATING_PROJECTION, INPUT_STATE, LEARNING, LEARNING_PROJECTION, MAPPING_PROJECTION, MATRIX_KEYWORD_SET, MECHANISM, OUTPUT_STATE, PARAMETER_STATE_PARAMS, PROJECTION, PROJECTION_SENDER, PROJECTION_TYPE, kwAddInputState, kwAddOutputState, kwProjectionComponentCategory +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.globals.registry import register_category +from psyneulink.globals.utilities import ContentAddressableList, iscompatible, type_match ProjectionRegistry = {} @@ -520,8 +520,8 @@ def __init__(self, :param context: (str) :return: None """ - from PsyNeuLink.Components.States.ParameterState import ParameterState - from PsyNeuLink.Components.States.State import State_Base + from psyneulink.components.states.parameterstate import ParameterState + from psyneulink.components.states.state import State_Base if not isinstance(context, Projection_Base): raise ProjectionError("Direct call to abstract class Projection() is not allowed; " @@ -720,7 +720,7 @@ def _instantiate_attributes_before_function(self, context=None): def _instantiate_parameter_states(self, context=None): - from PsyNeuLink.Components.States.ParameterState import _instantiate_parameter_states + from psyneulink.components.states.parameterstate import _instantiate_parameter_states _instantiate_parameter_states(owner=self, context=context) @@ -736,8 +736,8 @@ def _instantiate_sender(self, context=None): If self.value / self.instance_defaults.variable is None, set to sender.value """ - from PsyNeuLink.Components.States.OutputState import OutputState - from PsyNeuLink.Components.States.ParameterState import ParameterState + from psyneulink.components.states.outputstate import OutputState + from psyneulink.components.states.parameterstate import ParameterState # If sender is specified as a Mechanism (rather than a State), # get relevant OutputState and assign it to self.sender @@ -888,7 +888,7 @@ def _is_projection_spec(spec, include_matrix_keywords=True): if include_matrix_keywords: if isinstance(spec, str) and spec in MATRIX_KEYWORD_SET: return True - from PsyNeuLink.Components.Functions.Function import get_matrix + from psyneulink.components.functions.function import get_matrix if get_matrix(spec) is not None: return True if isinstance(spec, tuple) and len(spec) == 2: @@ -1042,10 +1042,10 @@ def _add_projection_to(receiver, state, projection_spec, context=None): # IMPLEMENTATION NOTE: ADD FULL SET OF ParameterState SPECIFICATIONS # CURRENTLY, ASSUMES projection_spec IS AN ALREADY INSTANTIATED PROJECTION - from PsyNeuLink.Components.States.State import _instantiate_state - from PsyNeuLink.Components.States.State import State_Base - from PsyNeuLink.Components.States.InputState import InputState - from PsyNeuLink.Components.States.ParameterState import ParameterState + from psyneulink.components.states.state import _instantiate_state + from psyneulink.components.states.state import State_Base + from psyneulink.components.states.inputstate import InputState + from psyneulink.components.states.parameterstate import ParameterState if not isinstance(state, (int, str, InputState, ParameterState)): raise ProjectionError("State specification(s) for {0} (as receivers of {1}) contain(s) one or more items" @@ -1146,9 +1146,9 @@ def _add_projection_from(sender, state, projection_spec, receiver, context=None) """ - from PsyNeuLink.Components.States.State import _instantiate_state - from PsyNeuLink.Components.States.State import State_Base - from PsyNeuLink.Components.States.OutputState import OutputState + from psyneulink.components.states.state import _instantiate_state + from psyneulink.components.states.state import State_Base + from psyneulink.components.states.outputstate import OutputState # Validate that projection is not already assigned to sender; if so, warn and ignore @@ -1222,7 +1222,7 @@ def _add_projection_from(sender, state, projection_spec, receiver, context=None) sender.output_states[output_state.name] = output_state # No OutputState(s) yet, so create them except AttributeError: - from PsyNeuLink.Components.States.State import State_Base + from psyneulink.components.states.state import State_Base sender.output_states = ContentAddressableList(component_type=State_Base, list=[output_state], name=sender.name+'.output_states') diff --git a/PsyNeuLink/Components/ShellClasses.py b/psyneulink/components/shellclasses.py similarity index 99% rename from PsyNeuLink/Components/ShellClasses.py rename to psyneulink/components/shellclasses.py index b0659990a07..f7312561d48 100644 --- a/PsyNeuLink/Components/ShellClasses.py +++ b/psyneulink/components/shellclasses.py @@ -27,7 +27,7 @@ """ -from PsyNeuLink.Components.Component import Component +from psyneulink.components.component import Component class ShellClassError(Exception): diff --git a/PsyNeuLink/Components/States/ModulatorySignals/__init__.py b/psyneulink/components/states/__init__.py similarity index 100% rename from PsyNeuLink/Components/States/ModulatorySignals/__init__.py rename to psyneulink/components/states/__init__.py diff --git a/PsyNeuLink/Components/States/InputState.py b/psyneulink/components/states/inputstate.py similarity index 98% rename from PsyNeuLink/Components/States/InputState.py rename to psyneulink/components/states/inputstate.py index 22bf8c790d9..47eab9a2603 100644 --- a/PsyNeuLink/Components/States/InputState.py +++ b/psyneulink/components/states/inputstate.py @@ -286,13 +286,13 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Component import InitStatus -from PsyNeuLink.Components.Functions.Function import Linear, LinearCombination -from PsyNeuLink.Components.States.State import StateError, State_Base, _instantiate_state_list, state_type_keywords -from PsyNeuLink.Globals.Keywords import EXPONENT, FUNCTION, INPUT_STATE, INPUT_STATE_PARAMS, MAPPING_PROJECTION, PROJECTION_TYPE, SUM, VARIABLE, WEIGHT -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Globals.Utilities import append_type_to_name, iscompatible +from psyneulink.components.component import InitStatus +from psyneulink.components.functions.function import Linear, LinearCombination +from psyneulink.components.states.state import StateError, State_Base, _instantiate_state_list, state_type_keywords +from psyneulink.globals.keywords import EXPONENT, FUNCTION, INPUT_STATE, INPUT_STATE_PARAMS, MAPPING_PROJECTION, PROJECTION_TYPE, SUM, VARIABLE, WEIGHT +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.globals.utilities import append_type_to_name, iscompatible state_type_keywords = state_type_keywords.update({INPUT_STATE}) # InputStatePreferenceSet = ComponentPreferenceSet(log_pref=logPrefTypeDefault, diff --git a/PsyNeuLink/Components/States/__init__.py b/psyneulink/components/states/modulatorysignals/__init__.py similarity index 100% rename from PsyNeuLink/Components/States/__init__.py rename to psyneulink/components/states/modulatorysignals/__init__.py diff --git a/PsyNeuLink/Components/States/ModulatorySignals/ControlSignal.py b/psyneulink/components/states/modulatorysignals/controlsignal.py similarity index 98% rename from PsyNeuLink/Components/States/ModulatorySignals/ControlSignal.py rename to psyneulink/components/states/modulatorysignals/controlsignal.py index 5823255814b..405a15692ef 100644 --- a/PsyNeuLink/Components/States/ModulatorySignals/ControlSignal.py +++ b/psyneulink/components/states/modulatorysignals/controlsignal.py @@ -282,26 +282,26 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Component import InitStatus, function_type, method_type +from psyneulink.components.component import InitStatus, function_type, method_type # import Components # FIX: EVCControlMechanism IS IMPORTED HERE TO DEAL WITH COST FUNCTIONS THAT ARE DEFINED IN EVCControlMechanism # SHOULD THEY BE LIMITED TO EVC?? -from PsyNeuLink.Components.Functions.Function import CombinationFunction, Exponential, IntegratorFunction, Linear, \ +from psyneulink.components.functions.function import CombinationFunction, Exponential, IntegratorFunction, Linear, \ LinearCombination, Reduce, SimpleIntegrator, TransferFunction, _is_modulation_param, is_function_type -from PsyNeuLink.Components.ShellClasses import Function, Mechanism -from PsyNeuLink.Components.States.ModulatorySignals.ModulatorySignal import ModulatorySignal -from PsyNeuLink.Components.States.OutputState import PRIMARY_OUTPUT_STATE -from PsyNeuLink.Components.States.State import State_Base -from PsyNeuLink.Globals.Defaults import defaultControlAllocation -from PsyNeuLink.Globals.Keywords import ALLOCATION_SAMPLES, AUTO, CONTROLLED_PARAM, CONTROL_PROJECTION, EXECUTING, \ +from psyneulink.components.shellclasses import Function, Mechanism +from psyneulink.components.states.modulatorysignals.modulatorysignal import ModulatorySignal +from psyneulink.components.states.outputstate import PRIMARY_OUTPUT_STATE +from psyneulink.components.states.state import State_Base +from psyneulink.globals.defaults import defaultControlAllocation +from psyneulink.globals.keywords import ALLOCATION_SAMPLES, AUTO, CONTROLLED_PARAM, CONTROL_PROJECTION, EXECUTING, \ FUNCTION, FUNCTION_PARAMS, INTERCEPT, OFF, ON, OUTPUT_STATES, OUTPUT_STATE_PARAMS, PROJECTION_TYPE, SEPARATOR_BAR, \ SLOPE, SUM, kwAssign -from PsyNeuLink.Globals.Log import LogEntry, LogLevel -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Globals.Utilities import is_numeric, iscompatible, kwCompatibilityLength, kwCompatibilityNumeric, \ +from psyneulink.globals.log import LogEntry, LogLevel +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.globals.utilities import is_numeric, iscompatible, kwCompatibilityLength, kwCompatibilityNumeric, \ kwCompatibilityType -from PsyNeuLink.Scheduling.TimeScale import CurrentTime, TimeScale +from psyneulink.scheduling.timescale import CurrentTime, TimeScale # class OutputStateLog(IntEnum): # NONE = 0 @@ -1200,10 +1200,10 @@ def _parse_control_signal_spec(owner, control_signal_spec, context=None): CONTROL_SIGNAL:ControlSignal or None PARAMS:dict - params dict if any were included in the state_spec """ - from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection - from PsyNeuLink.Components.States.State import _parse_state_spec - from PsyNeuLink.Components.States.ParameterState import ParameterState, _get_parameter_state - from PsyNeuLink.Globals.Keywords import NAME, PARAMS, \ + from psyneulink.components.projections.modulatory.controlprojection import ControlProjection + from psyneulink.components.states.state import _parse_state_spec + from psyneulink.components.states.parameterstate import ParameterState, _get_parameter_state + from psyneulink.globals.keywords import NAME, PARAMS, \ CONTROL_SIGNAL, CONTROL_SIGNAL_SPECS, PARAMETER_STATE, \ MECHANISM, PROJECTIONS, SENDER, RECEIVER diff --git a/PsyNeuLink/Components/States/ModulatorySignals/GatingSignal.py b/psyneulink/components/states/modulatorysignals/gatingsignal.py similarity index 97% rename from PsyNeuLink/Components/States/ModulatorySignals/GatingSignal.py rename to psyneulink/components/states/modulatorysignals/gatingsignal.py index 6d3b6ccb036..ff9929f3cba 100644 --- a/PsyNeuLink/Components/States/ModulatorySignals/GatingSignal.py +++ b/psyneulink/components/states/modulatorysignals/gatingsignal.py @@ -226,16 +226,16 @@ import typecheck as tc -from PsyNeuLink.Components.Component import InitStatus -from PsyNeuLink.Components.Functions.Function import Linear, LinearCombination, _is_modulation_param -from PsyNeuLink.Components.ShellClasses import Mechanism -from PsyNeuLink.Components.States.InputState import InputState -from PsyNeuLink.Components.States.ModulatorySignals.ModulatorySignal import ModulatorySignal, modulatory_signal_keywords -from PsyNeuLink.Components.States.OutputState import OutputState, PRIMARY_OUTPUT_STATE -from PsyNeuLink.Components.States.State import State_Base -from PsyNeuLink.Globals.Keywords import GATE, GATING_PROJECTION, GATING_SIGNAL, GATING_SIGNALS, INPUT_STATE, MECHANISM, NAME, OUTPUT_STATE, OUTPUT_STATES, OUTPUT_STATE_PARAMS, PARAMS, PROJECTION_TYPE, STATES, SUM -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel +from psyneulink.components.component import InitStatus +from psyneulink.components.functions.function import Linear, LinearCombination, _is_modulation_param +from psyneulink.components.shellclasses import Mechanism +from psyneulink.components.states.inputstate import InputState +from psyneulink.components.states.modulatorysignals.modulatorysignal import ModulatorySignal, modulatory_signal_keywords +from psyneulink.components.states.outputstate import OutputState, PRIMARY_OUTPUT_STATE +from psyneulink.components.states.state import State_Base +from psyneulink.globals.keywords import GATE, GATING_PROJECTION, GATING_SIGNAL, GATING_SIGNALS, INPUT_STATE, MECHANISM, NAME, OUTPUT_STATE, OUTPUT_STATES, OUTPUT_STATE_PARAMS, PARAMS, PROJECTION_TYPE, STATES, SUM +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel class GatingSignalError(Exception): @@ -478,9 +478,9 @@ def _parse_gating_signal_spec(owner, state_spec): PARAMS:dict - params dict if any were included in the state_spec """ - from PsyNeuLink.Components.States.ModulatorySignals.GatingSignal import GatingSignal - from PsyNeuLink.Components.Projections.Projection import _validate_receiver - from PsyNeuLink.Components.Projections.ModulatoryProjections.GatingProjection import GatingProjection + from psyneulink.components.states.modulatorysignals.gatingsignal import GatingSignal + from psyneulink.components.projections.projection import _validate_receiver + from psyneulink.components.projections.modulatory.gatingprojection import GatingProjection GATING_SIGNAL_SUFFIX = '_' + GatingSignal.__name__ DEFAULT_GATING_SIGNAL_NAME = 'Default'+ GATING_SIGNAL_SUFFIX diff --git a/PsyNeuLink/Components/States/ModulatorySignals/LearningSignal.py b/psyneulink/components/states/modulatorysignals/learningsignal.py similarity index 97% rename from PsyNeuLink/Components/States/ModulatorySignals/LearningSignal.py rename to psyneulink/components/states/modulatorysignals/learningsignal.py index eea8f7b3700..922c7cf39f8 100644 --- a/PsyNeuLink/Components/States/ModulatorySignals/LearningSignal.py +++ b/psyneulink/components/states/modulatorysignals/learningsignal.py @@ -170,14 +170,14 @@ import typecheck as tc -from PsyNeuLink.Components.Functions.Function import Linear, LinearCombination, ModulationParam, _is_modulation_param -from PsyNeuLink.Components.States.ModulatorySignals.ModulatorySignal import ModulatorySignal -from PsyNeuLink.Components.States.OutputState import PRIMARY_OUTPUT_STATE -from PsyNeuLink.Components.States.State import State_Base -from PsyNeuLink.Globals.Keywords import LEARNED_PARAM, LEARNING_PROJECTION, OUTPUT_STATES, OUTPUT_STATE_PARAMS, PROJECTION_TYPE, SUM -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Globals.Utilities import parameter_spec +from psyneulink.components.functions.function import Linear, LinearCombination, ModulationParam, _is_modulation_param +from psyneulink.components.states.modulatorysignals.modulatorysignal import ModulatorySignal +from psyneulink.components.states.outputstate import PRIMARY_OUTPUT_STATE +from psyneulink.components.states.state import State_Base +from psyneulink.globals.keywords import LEARNED_PARAM, LEARNING_PROJECTION, OUTPUT_STATES, OUTPUT_STATE_PARAMS, PROJECTION_TYPE, SUM +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.globals.utilities import parameter_spec class LearningSignalError(Exception): diff --git a/PsyNeuLink/Components/States/ModulatorySignals/ModulatorySignal.py b/psyneulink/components/states/modulatorysignals/modulatorysignal.py similarity index 97% rename from PsyNeuLink/Components/States/ModulatorySignals/ModulatorySignal.py rename to psyneulink/components/states/modulatorysignals/modulatorysignal.py index 2f8b3863434..9f1aad1361c 100644 --- a/PsyNeuLink/Components/States/ModulatorySignals/ModulatorySignal.py +++ b/psyneulink/components/states/modulatorysignals/modulatorysignal.py @@ -196,12 +196,12 @@ --------------- """ -from PsyNeuLink.Components.Component import InitStatus, component_keywords -from PsyNeuLink.Components.ShellClasses import Mechanism, State -from PsyNeuLink.Components.States.OutputState import OutputState -from PsyNeuLink.Components.States.State import StateError, State_Base -from PsyNeuLink.Globals.Keywords import MECHANISM, MODULATION, MODULATORY_SIGNAL -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel +from psyneulink.components.component import InitStatus, component_keywords +from psyneulink.components.shellclasses import Mechanism, State +from psyneulink.components.states.outputstate import OutputState +from psyneulink.components.states.state import StateError, State_Base +from psyneulink.globals.keywords import MECHANISM, MODULATION, MODULATORY_SIGNAL +from psyneulink.globals.preferences.preferenceset import PreferenceLevel class ModulatorySignalError(Exception): @@ -396,7 +396,7 @@ def _instantiate_projections(self, projections, context=None): Call _instantiate_projection_from_state to assign ModulatoryProjections to .efferents """ - from PsyNeuLink.Components.Projections.ModulatoryProjections.ModulatoryProjection \ + from psyneulink.components.projections.modulatory.modulatoryprojection \ import ModulatoryProjection_Base modulatory_projection_specs = [proj for proj in projections diff --git a/PsyNeuLink/Components/States/OutputState.py b/psyneulink/components/states/outputstate.py similarity index 98% rename from PsyNeuLink/Components/States/OutputState.py rename to psyneulink/components/states/outputstate.py index 354dc398b0d..39acc0ed918 100644 --- a/PsyNeuLink/Components/States/OutputState.py +++ b/psyneulink/components/states/outputstate.py @@ -324,15 +324,15 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Component import Component, InitStatus -from PsyNeuLink.Components.Functions.Function import Linear, LinearCombination, is_function_type -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.States.State import State_Base, _instantiate_state_list, state_type_keywords -from PsyNeuLink.Globals.Keywords import CALCULATE, INDEX, MAPPING_PROJECTION, MEAN, MEDIAN, NAME, OUTPUT_STATE, OUTPUT_STATES, OUTPUT_STATE_PARAMS, PROJECTION_TYPE, RESULT, STANDARD_DEVIATION, STANDARD_OUTPUT_STATES, SUM, VARIANCE -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Globals.Utilities import UtilitiesError -from PsyNeuLink.Globals.Utilities import iscompatible, type_match +from psyneulink.components.component import Component, InitStatus +from psyneulink.components.functions.function import Linear, LinearCombination, is_function_type +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.states.state import State_Base, _instantiate_state_list, state_type_keywords +from psyneulink.globals.keywords import CALCULATE, INDEX, MAPPING_PROJECTION, MEAN, MEDIAN, NAME, OUTPUT_STATE, OUTPUT_STATES, OUTPUT_STATE_PARAMS, PROJECTION_TYPE, RESULT, STANDARD_DEVIATION, STANDARD_OUTPUT_STATES, SUM, VARIANCE +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.globals.utilities import UtilitiesError +from psyneulink.globals.utilities import iscompatible, type_match state_type_keywords = state_type_keywords.update({OUTPUT_STATE}) @@ -709,9 +709,9 @@ def _instantiate_projections(self, projections, context=None): Call _instantiate_projections_from_state to assign MappingProjections to .efferents """ - from PsyNeuLink.Components.Projections.ModulatoryProjections.ModulatoryProjection import ModulatoryProjection_Base - from PsyNeuLink.Components.States.ModulatorySignals.ModulatorySignal import ModulatorySignal - from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.AdaptiveMechanism import AdaptiveMechanism_Base + from psyneulink.components.projections.modulatory.modulatoryprojection import ModulatoryProjection_Base + from psyneulink.components.states.modulatorysignals.modulatorysignal import ModulatorySignal + from psyneulink.components.mechanisms.adaptive.adaptivemechanism import AdaptiveMechanism_Base # Treat as ModulatoryProjection spec if it is a ModulatoryProjection, ModulatorySignal or AdaptiveMechanism modulatory_projections = [proj for proj in projections diff --git a/PsyNeuLink/Components/States/ParameterState.py b/psyneulink/components/states/parameterstate.py similarity index 97% rename from PsyNeuLink/Components/States/ParameterState.py rename to psyneulink/components/states/parameterstate.py index b0c4cd4ec67..be8833fafa2 100644 --- a/PsyNeuLink/Components/States/ParameterState.py +++ b/psyneulink/components/states/parameterstate.py @@ -283,15 +283,15 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Component import Component, function_type, method_type, parameter_keywords -from PsyNeuLink.Components.Functions.Function import Linear, get_param_value_for_keyword -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.ShellClasses import Mechanism, Projection -from PsyNeuLink.Components.States.State import StateError, State_Base, _instantiate_state, state_type_keywords -from PsyNeuLink.Globals.Keywords import CONTROL_PROJECTION, FUNCTION, FUNCTION_PARAMS, MECHANISM, PARAMETER_STATE, PARAMETER_STATES, PARAMETER_STATE_PARAMS, PATHWAY_PROJECTION, PROJECTION, PROJECTION_TYPE, VALUE -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Globals.Utilities import ContentAddressableList, ReadOnlyOrderedDict, is_numeric, is_value_spec, iscompatible +from psyneulink.components.component import Component, function_type, method_type, parameter_keywords +from psyneulink.components.functions.function import Linear, get_param_value_for_keyword +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.shellclasses import Mechanism, Projection +from psyneulink.components.states.state import StateError, State_Base, _instantiate_state, state_type_keywords +from psyneulink.globals.keywords import CONTROL_PROJECTION, FUNCTION, FUNCTION_PARAMS, MECHANISM, PARAMETER_STATE, PARAMETER_STATES, PARAMETER_STATE_PARAMS, PATHWAY_PROJECTION, PROJECTION, PROJECTION_TYPE, VALUE +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.globals.utilities import ContentAddressableList, ReadOnlyOrderedDict, is_numeric, is_value_spec, iscompatible state_type_keywords = state_type_keywords.update({PARAMETER_STATE}) @@ -544,7 +544,7 @@ def _instantiate_projections(self, projections, context=None): # MODIFIED 7/8/17 # FIX: THIS SHOULD ALSO LOOK FOR OTHER FORMS OF SPECIFICATION # FIX: OF A PathwayProjection (E.G., TARGET STATE OR MECHANISM) - from PsyNeuLink.Components.Projections.PathwayProjections.PathwayProjection import PathwayProjection_Base + from psyneulink.components.projections.pathway.pathwayprojection import PathwayProjection_Base pathway_projections = [proj for proj in projections if isinstance(proj, PathwayProjection_Base)] if pathway_projections: pathway_proj_names = [] @@ -676,16 +676,16 @@ def _instantiate_parameter_state(owner, param_name, param_value, context): # WHAT ABOUT GatingProjection?? # Allow ControlProjection, LearningProjection elif isinstance(param_value, Projection): - from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection - from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection + from psyneulink.components.projections.modulatory.controlprojection import ControlProjection + from psyneulink.components.projections.modulatory.learningprojection import LearningProjection if isinstance(param_value, (ControlProjection, LearningProjection)): pass else: return # Allow Projection class elif inspect.isclass(param_value) and issubclass(param_value, Projection): - from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection - from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection + from psyneulink.components.projections.modulatory.controlprojection import ControlProjection + from psyneulink.components.projections.modulatory.learningprojection import LearningProjection if issubclass(param_value, (ControlProjection, LearningProjection)): pass else: diff --git a/PsyNeuLink/Components/States/State.py b/psyneulink/components/states/state.py similarity index 98% rename from PsyNeuLink/Components/States/State.py rename to psyneulink/components/states/state.py index 17510dd7d01..8395e61afd3 100644 --- a/PsyNeuLink/Components/States/State.py +++ b/psyneulink/components/states/state.py @@ -309,12 +309,12 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Component import Component, ComponentError, InitStatus, component_keywords, function_type -from PsyNeuLink.Components.Functions.Function import LinearCombination, ModulationParam, _get_modulated_param, get_param_value_for_function, get_param_value_for_keyword -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.Projections.Projection import _is_projection_spec -from PsyNeuLink.Components.ShellClasses import Mechanism, Process, Projection, State -from PsyNeuLink.Globals.Keywords import VARIABLE, SIZE, FUNCTION_PARAMS, NAME, OWNER, PARAMS, CONTEXT, EXECUTING, \ +from psyneulink.components.component import Component, ComponentError, InitStatus, component_keywords, function_type +from psyneulink.components.functions.function import LinearCombination, ModulationParam, _get_modulated_param, get_param_value_for_function, get_param_value_for_keyword +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.projections.projection import _is_projection_spec +from psyneulink.components.shellclasses import Mechanism, Process, Projection, State +from psyneulink.globals.keywords import VARIABLE, SIZE, FUNCTION_PARAMS, NAME, OWNER, PARAMS, CONTEXT, EXECUTING, \ VALUE, STATE, STATE_PARAMS, STATE_TYPE, STATE_VALUE, \ STANDARD_ARGS, STANDARD_OUTPUT_STATES, \ PROJECTIONS, PROJECTION_PARAMS, PROJECTION_TYPE, RECEIVER, SENDER, \ @@ -324,14 +324,14 @@ CONTROL, CONTROL_PROJECTION, CONTROL_PROJECTION_PARAMS, CONTROL_SIGNAL_SPECS, \ GATING, GATING_PROJECTION, GATING_PROJECTION_PARAMS, GATING_SIGNAL_SPECS, INITIALIZING, \ kwAssign, kwStateComponentCategory, kwStateContext, kwStateName, kwStatePrefs -from PsyNeuLink.Globals.Log import LogEntry, LogLevel -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import kpVerbosePref -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Globals.Registry import register_category -from PsyNeuLink.Globals.Utilities import ContentAddressableList, MODULATION_OVERRIDE, Modulation, \ +from psyneulink.globals.log import LogEntry, LogLevel +from psyneulink.globals.preferences.componentpreferenceset import kpVerbosePref +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.globals.registry import register_category +from psyneulink.globals.utilities import ContentAddressableList, MODULATION_OVERRIDE, Modulation, \ append_type_to_name, convert_to_np_array, get_class_attributes, is_value_spec, iscompatible, is_numeric, \ merge_param_dicts, type_match -from PsyNeuLink.Scheduling.TimeScale import CurrentTime, TimeScale +from psyneulink.scheduling.timescale import CurrentTime, TimeScale state_keywords = component_keywords.copy() state_keywords.update({STATE_VALUE, @@ -924,12 +924,12 @@ def _instantiate_projections_to_state(self, projections, context=None): If kwMStateProjections is absent or empty, no projections are created """ - from PsyNeuLink.Components.Projections.Projection import Projection_Base - from PsyNeuLink.Components.Projections.PathwayProjections.PathwayProjection \ + from psyneulink.components.projections.projection import Projection_Base + from psyneulink.components.projections.pathway.pathwayprojection \ import PathwayProjection_Base - from PsyNeuLink.Components.Projections.ModulatoryProjections.ModulatoryProjection \ + from psyneulink.components.projections.modulatory.modulatoryprojection \ import ModulatoryProjection_Base - from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ProcessingMechanism import ProcessingMechanism_Base + from psyneulink.components.mechanisms.processing.processingmechanism import ProcessingMechanism_Base # If specification is not a list, wrap it in one for consistency of treatment below # (since specification can be a list, so easier to treat any as a list) @@ -1207,7 +1207,7 @@ def _instantiate_projection_from_state(self, projection_spec, receiver, context= If kwMStateProjections is absent or empty, no projections are created """ - from PsyNeuLink.Components.Projections.Projection import Projection_Base, ProjectionRegistry + from psyneulink.components.projections.projection import Projection_Base, ProjectionRegistry state_name_string = self.name item_prefix_string = "" @@ -1238,7 +1238,7 @@ def _instantiate_projection_from_state(self, projection_spec, receiver, context= # ALLOW SPEC TO BE ANY STATE (INCLUDING OutPutState, FOR GATING PROJECTIONS) # OR MECHANISM (IN WHICH CASE PRIMARY INPUTSTATE IS ASSUMED) # Must be an InputState or ParameterState - from PsyNeuLink.Components.ShellClasses import State + from psyneulink.components.shellclasses import State if not isinstance(receiver, (State, Mechanism)): raise StateError("Receiver ({}) of {} from {} must be a State or Mechanism". format(receiver, projection_spec, self.name)) @@ -1519,7 +1519,7 @@ def _parse_projection_ref(self, projection_spec = GATING_PROJECTION try: - from PsyNeuLink.Components.Projections.Projection import ProjectionRegistry + from psyneulink.components.projections.projection import ProjectionRegistry projection_spec = ProjectionRegistry[projection_spec].subclass except KeyError: # projection_spec was not a recognized key @@ -1588,15 +1588,15 @@ def update(self, params=None, time_scale=TimeScale.TRIAL, context=None): for value in self._mod_proj_values: self._mod_proj_values[value] = [] - from PsyNeuLink.Components.Process import ProcessInputState - from PsyNeuLink.Components.Projections.PathwayProjections.PathwayProjection \ + from psyneulink.components.process import ProcessInputState + from psyneulink.components.projections.pathway.pathwayprojection \ import PathwayProjection_Base - from PsyNeuLink.Components.Projections.ModulatoryProjections.ModulatoryProjection \ + from psyneulink.components.projections.modulatory.modulatoryprojection \ import ModulatoryProjection_Base - from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection - from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection - from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection - from PsyNeuLink.Components.Projections.ModulatoryProjections.GatingProjection import GatingProjection + from psyneulink.components.projections.pathway.mappingprojection import MappingProjection + from psyneulink.components.projections.modulatory.learningprojection import LearningProjection + from psyneulink.components.projections.modulatory.controlprojection import ControlProjection + from psyneulink.components.projections.modulatory.gatingprojection import GatingProjection # If owner is a Mechanism, get its execution_id if isinstance(self.owner, (Mechanism, Process)): @@ -2248,14 +2248,14 @@ def _check_state_ownership(owner, param_name, mechanism_state): def _check_projection_sender_compatability(owner, projection_type, sender_type): - from PsyNeuLink.Components.States.OutputState import OutputState - from PsyNeuLink.Components.States.ModulatorySignals.LearningSignal import LearningSignal - from PsyNeuLink.Components.States.ModulatorySignals.ControlSignal import ControlSignal - from PsyNeuLink.Components.States.ModulatorySignals.GatingSignal import GatingSignal - from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection - from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection - from PsyNeuLink.Components.Projections.ModulatoryProjections.GatingProjection import GatingProjection - from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ProcessingMechanism import ProcessingMechanism_Base + from psyneulink.components.states.outputstate import OutputState + from psyneulink.components.states.modulatorysignals.learningsignal import LearningSignal + from psyneulink.components.states.modulatorysignals.controlsignal import ControlSignal + from psyneulink.components.states.modulatorysignals.gatingsignal import GatingSignal + from psyneulink.components.projections.modulatory.learningprojection import LearningProjection + from psyneulink.components.projections.modulatory.controlprojection import ControlProjection + from psyneulink.components.projections.modulatory.gatingprojection import GatingProjection + from psyneulink.components.mechanisms.processing.processingmechanism import ProcessingMechanism_Base if issubclass(projection_type, MappingProjection) and issubclass(sender_type, (OutputState, ProcessingMechanism_Base)): @@ -2299,7 +2299,7 @@ def _parse_state_type(owner, state_spec): # return owner.standard_output_states.get_dict(state_spec) # from PsyNeuLink.Components.States.OutputState import StandardOutputStates if owner.standard_output_states.get_state_dict(state_spec): - from PsyNeuLink.Components.States.OutputState import OutputState + from psyneulink.components.states.outputstate import OutputState return OutputState # State specification dict diff --git a/PsyNeuLink/Components/System.py b/psyneulink/components/system.py similarity index 98% rename from PsyNeuLink/Components/System.py rename to psyneulink/components/system.py index 619343cd48f..b722c06de43 100644 --- a/PsyNeuLink/Components/System.py +++ b/psyneulink/components/system.py @@ -435,20 +435,20 @@ import typecheck as tc from toposort import toposort, toposort_flatten -from PsyNeuLink.Components.Component import Component, ExecutionStatus, InitStatus, function_type -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.ControlMechanism.ControlMechanism import ControlMechanism, OBJECTIVE_MECHANISM -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.LearningMechanism.LearningMechanism import LearningMechanism -from PsyNeuLink.Components.Mechanisms.Mechanism import MechanismList, MonitoredOutputStatesOption -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ObjectiveMechanism import MonitoredOutputStateTuple, OUTPUT_STATE_INDEX, ObjectiveMechanism -from PsyNeuLink.Components.Process import ProcessList, ProcessTuple, Process_Base -from PsyNeuLink.Components.ShellClasses import Mechanism, Process, System -from PsyNeuLink.Globals.Keywords import ALL, COMPONENT_INIT, CONROLLER_PHASE_SPEC, CONTROL, CONTROLLER, CONTROL_SIGNAL_SPECS, CYCLE, EVC_SIMULATION, EXECUTING, FUNCTION, IDENTITY_MATRIX, INITIALIZED, INITIALIZE_CYCLE, INITIALIZING, INITIAL_VALUES, INTERNAL, LEARNING, LEARNING_SIGNAL, MATRIX, MONITOR_FOR_CONTROL, ORIGIN, SAMPLE, SINGLETON, SYSTEM, SYSTEM_INIT, TARGET, TERMINAL, TIME_SCALE, kwSeparator, kwSystemComponentCategory -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Globals.Registry import register_category -from PsyNeuLink.Globals.Utilities import ContentAddressableList, append_type_to_name, convert_to_np_array, iscompatible, parameter_spec -from PsyNeuLink.Scheduling.Scheduler import Scheduler -from PsyNeuLink.Scheduling.TimeScale import CentralClock, TimeScale +from psyneulink.components.component import Component, ExecutionStatus, InitStatus, function_type +from psyneulink.components.mechanisms.adaptive.control.controlmechanism import ControlMechanism, OBJECTIVE_MECHANISM +from psyneulink.components.mechanisms.adaptive.learning.learningmechanism import LearningMechanism +from psyneulink.components.mechanisms.mechanism import MechanismList, MonitoredOutputStatesOption +from psyneulink.components.mechanisms.processing.objectivemechanism import MonitoredOutputStateTuple, OUTPUT_STATE_INDEX, ObjectiveMechanism +from psyneulink.components.process import ProcessList, ProcessTuple, Process_Base +from psyneulink.components.shellclasses import Mechanism, Process, System +from psyneulink.globals.keywords import ALL, COMPONENT_INIT, CONROLLER_PHASE_SPEC, CONTROL, CONTROLLER, CONTROL_SIGNAL_SPECS, CYCLE, EVC_SIMULATION, EXECUTING, FUNCTION, IDENTITY_MATRIX, INITIALIZED, INITIALIZE_CYCLE, INITIALIZING, INITIAL_VALUES, INTERNAL, LEARNING, LEARNING_SIGNAL, MATRIX, MONITOR_FOR_CONTROL, ORIGIN, SAMPLE, SINGLETON, SYSTEM, SYSTEM_INIT, TARGET, TERMINAL, TIME_SCALE, kwSeparator, kwSystemComponentCategory +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.globals.registry import register_category +from psyneulink.globals.utilities import ContentAddressableList, append_type_to_name, convert_to_np_array, iscompatible, parameter_spec +from psyneulink.scheduling.scheduler import Scheduler +from psyneulink.scheduling.timescale import CentralClock, TimeScale logger = logging.getLogger(__name__) @@ -495,7 +495,7 @@ def __str__(self): # FIX: NEED TO CREATE THE PROJECTIONS FROM THE PROCESS TO THE FIRST MECHANISM IN PROCESS FIRST SINCE, # FIX: ONCE IT IS IN THE GRAPH, IT IS NOT LONGER EASY TO DETERMINE WHICH IS WHICH IS WHICH (SINCE SETS ARE NOT ORDERED) -from PsyNeuLink.Components.Process import process +from psyneulink.components.process import process # System factory method: @tc.typecheck @@ -1086,7 +1086,7 @@ def _instantiate_processes(self, input=None, context=None): # Assign default Process if PROCESS is empty, or invalid if not processes_spec: - from PsyNeuLink.Components.Process import Process_Base + from psyneulink.components.process import Process_Base processes_spec.append(ProcessTuple(Process_Base(), None)) # If input to system is specified, number of items must equal number of processes with origin mechanisms @@ -1687,7 +1687,7 @@ def _instantiate_stimulus_inputs(self, context=None): self.inputs.append(stimulus_input_state.value) # Add MappingProjection from stimulus_input_state to ORIGIN mechainsm's inputState - from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection + from psyneulink.components.projections.pathway.mappingprojection import MappingProjection MappingProjection(sender=stimulus_input_state, receiver=origin_mech, name=self.name+' Input Projection to '+origin_mech.name) @@ -1703,7 +1703,7 @@ def build_dependency_sets_by_traversing_projections(sender_mech, process): # MappingProjections are legal recipients of learning projections (hence the call) # but do not send any projections, so no need to consider further - from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection + from psyneulink.components.projections.pathway.mappingprojection import MappingProjection if isinstance(sender_mech, MappingProjection): return @@ -1782,7 +1782,7 @@ def build_dependency_sets_by_traversing_projections(sender_mech, process): raise SystemError("{} does not project to a LearningMechanism in the same process {}". format(sender_mech.name, process.name)) - from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.LearningMechanism.LearningAuxilliary \ + from psyneulink.components.mechanisms.adaptive.learning.learningauxilliary \ import ACTIVATION_INPUT, ERROR_SIGNAL # Get the ProcessingMechanism that projected to sender_mech @@ -1942,7 +1942,7 @@ def build_dependency_sets_by_traversing_projections(sender_mech, process): self._learning_mechs = [] self._target_mechs = [] - from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection + from psyneulink.components.projections.pathway.mappingprojection import MappingProjection for item in self.learningexecution_list: if isinstance(item, MappingProjection): continue @@ -2011,7 +2011,7 @@ def _instantiate_target_inputs(self, context=None): self.target_input_states.append(system_target_input_state) # Add MappingProjection from system_target_input_state to TARGET mechainsm's target inputState - from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection + from psyneulink.components.projections.pathway.mappingprojection import MappingProjection MappingProjection(sender=system_target_input_state, receiver=target_mech_TARGET_input_state, name=self.name+' Input Projection to '+target_mech_TARGET_input_state.name) @@ -2128,8 +2128,8 @@ def _get_monitored_output_states_for_system(self, controller=None, context=None) """ - from PsyNeuLink.Components.Mechanisms.Mechanism import MonitoredOutputStatesOption - from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ObjectiveMechanism \ + from psyneulink.components.mechanisms.mechanism import MonitoredOutputStatesOption + from psyneulink.components.mechanisms.processing.objectivemechanism \ import _parse_monitored_output_states # PARSE SPECS @@ -2479,7 +2479,7 @@ def execute(self, self.execution_status = ExecutionStatus.EXECUTING # Update execution_id for self and all mechanisms in graph (including learning) and controller - from PsyNeuLink.Globals.Run import _get_unique_id + from psyneulink.globals.run import _get_unique_id self._execution_id = execution_id or _get_unique_id() # FIX: GO THROUGH LEARNING GRAPH HERE AND ASSIGN EXECUTION TOKENS FOR ALL MECHANISMS IN IT # self.learningexecution_list @@ -2692,7 +2692,7 @@ def _execute_learning(self, clock=CentralClock, context=None): for component in next_execution_set: logger.debug('\tRunning component {0}'.format(component)) - from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection + from psyneulink.components.projections.pathway.mappingprojection import MappingProjection if isinstance(component, MappingProjection): continue @@ -2856,7 +2856,7 @@ def run(self, logger.debug(inputs) - from PsyNeuLink.Globals.Run import run + from psyneulink.globals.run import run return run(self, inputs=inputs, num_trials=num_trials, @@ -2918,7 +2918,7 @@ def _report_system_completion(self, clock=CentralClock): # re.sub('[\[,\],\n]','',str(["{:0.3}". # format(float(i)) for i in object_item.mechanism.output_state.value])))) if self.learning: - from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.ObjectiveMechanisms.ComparatorMechanism import MSE + from psyneulink.library.mechanisms.processing.objective.comparatormechanism import MSE for mech in self.target_mechanisms: if not MSE in mech.output_states: continue @@ -3102,8 +3102,8 @@ def inspect(self): output_state_names.append(name) output_value_array = np.array(output_value_array) - from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection - from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection + from psyneulink.components.projections.modulatory.controlprojection import ControlProjection + from psyneulink.components.projections.modulatory.learningprojection import LearningProjection learning_projections = [] controlled_parameters = [] for mech in list(self.mechanisms): @@ -3302,11 +3302,11 @@ def show_graph(self, """ - from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ObjectiveMechanism \ + from psyneulink.components.mechanisms.processing.objectivemechanism \ import ObjectiveMechanism - from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.LearningMechanism.LearningMechanism \ + from psyneulink.components.mechanisms.adaptive.learning.learningmechanism \ import LearningMechanism - from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection + from psyneulink.components.projections.pathway.mappingprojection import MappingProjection import graphviz as gv @@ -3468,7 +3468,7 @@ def show_graph(self, SYSTEM_TARGET_INPUT_STATE = 'SystemInputState' -from PsyNeuLink.Components.States.OutputState import OutputState +from psyneulink.components.states.outputstate import OutputState class SystemInputState(OutputState): """Represents inputs and targets specified in a call to the System's `execute ` and `run ` methods. diff --git a/PsyNeuLink/Composition.py b/psyneulink/composition.py similarity index 99% rename from PsyNeuLink/Composition.py rename to psyneulink/composition.py index b33e7ace020..4c34ab714b8 100644 --- a/PsyNeuLink/Composition.py +++ b/psyneulink/composition.py @@ -53,12 +53,12 @@ import numpy as np -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.CompositionInterfaceMechanism import CompositionInterfaceMechanism -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.ShellClasses import Mechanism, Projection -from PsyNeuLink.Globals.Keywords import EXECUTING -from PsyNeuLink.Scheduling.Scheduler import Scheduler -from PsyNeuLink.Scheduling.TimeScale import TimeScale +from psyneulink.components.mechanisms.processing.compositioninterfacemechanism import CompositionInterfaceMechanism +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.shellclasses import Mechanism, Projection +from psyneulink.globals.keywords import EXECUTING +from psyneulink.scheduling.scheduler import Scheduler +from psyneulink.scheduling.timescale import TimeScale logger = logging.getLogger(__name__) diff --git a/PsyNeuLink/Globals/Preferences/__init__.py b/psyneulink/globals/__init__.py similarity index 100% rename from PsyNeuLink/Globals/Preferences/__init__.py rename to psyneulink/globals/__init__.py diff --git a/PsyNeuLink/Globals/Defaults.py b/psyneulink/globals/defaults.py similarity index 96% rename from PsyNeuLink/Globals/Defaults.py rename to psyneulink/globals/defaults.py index 51be559fbd0..1dd48783a59 100644 --- a/PsyNeuLink/Globals/Defaults.py +++ b/psyneulink/globals/defaults.py @@ -14,7 +14,7 @@ from enum import Enum -from PsyNeuLink.Scheduling.TimeScale import TimeScale +from psyneulink.scheduling.timescale import TimeScale MPI_IMPLEMENTATION = False diff --git a/PsyNeuLink/Globals/Keywords.py b/psyneulink/globals/keywords.py similarity index 100% rename from PsyNeuLink/Globals/Keywords.py rename to psyneulink/globals/keywords.py diff --git a/PsyNeuLink/Globals/KVO.py b/psyneulink/globals/kvo.py similarity index 100% rename from PsyNeuLink/Globals/KVO.py rename to psyneulink/globals/kvo.py diff --git a/PsyNeuLink/Globals/Log.py b/psyneulink/globals/log.py similarity index 99% rename from PsyNeuLink/Globals/Log.py rename to psyneulink/globals/log.py index 50168e810c0..fa8a4255e57 100644 --- a/PsyNeuLink/Globals/Log.py +++ b/psyneulink/globals/log.py @@ -109,7 +109,7 @@ from collections import namedtuple from enum import IntEnum -from PsyNeuLink.Globals.Keywords import kwContext, kwTime, kwValue +from psyneulink.globals.keywords import kwContext, kwTime, kwValue class LogLevel(IntEnum): diff --git a/PsyNeuLink/Globals/__init__.py b/psyneulink/globals/preferences/__init__.py similarity index 100% rename from PsyNeuLink/Globals/__init__.py rename to psyneulink/globals/preferences/__init__.py diff --git a/PsyNeuLink/Globals/Preferences/ComponentPreferenceSet.py b/psyneulink/globals/preferences/componentpreferenceset.py similarity index 98% rename from PsyNeuLink/Globals/Preferences/ComponentPreferenceSet.py rename to psyneulink/globals/preferences/componentpreferenceset.py index ba86f26d98d..2e4c2fc6e62 100644 --- a/PsyNeuLink/Globals/Preferences/ComponentPreferenceSet.py +++ b/psyneulink/globals/preferences/componentpreferenceset.py @@ -12,10 +12,10 @@ import inspect -from PsyNeuLink.Globals.Keywords import NAME, kwDefaultPreferenceSetOwner, kwPrefLevel, kwPreferenceSetName, kwPrefs, kwPrefsOwner -from PsyNeuLink.Globals.Log import LogLevel -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceEntry, PreferenceLevel, PreferenceSet -from PsyNeuLink.Globals.Utilities import Modulation +from psyneulink.globals.keywords import NAME, kwDefaultPreferenceSetOwner, kwPrefLevel, kwPreferenceSetName, kwPrefs, kwPrefsOwner +from psyneulink.globals.log import LogLevel +from psyneulink.globals.preferences.preferenceset import PreferenceEntry, PreferenceLevel, PreferenceSet +from psyneulink.globals.utilities import Modulation # Keypaths for preferences: REPORT_OUTPUT_PREF = kpReportOutputPref = '_report_output_pref' @@ -274,12 +274,12 @@ def __init__(self, # If baseClass has not been assigned, do so here: if self.baseClass is None: - from PsyNeuLink.Components.Component import Component + from psyneulink.components.component import Component self.baseClass = Component # If owner is not specified, assign DefaultProcessingMechanism_Base as default owner if owner is None: - from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.DefaultProcessingMechanism import DefaultProcessingMechanism_Base + from psyneulink.components.mechanisms.processing.defaultprocessingmechanism import DefaultProcessingMechanism_Base DefaultPreferenceSetOwner = DefaultProcessingMechanism_Base(name=kwDefaultPreferenceSetOwner) owner = DefaultPreferenceSetOwner diff --git a/PsyNeuLink/Globals/Preferences/MechanismPreferenceSet.py b/psyneulink/globals/preferences/mechanismpreferenceset.py similarity index 98% rename from PsyNeuLink/Globals/Preferences/MechanismPreferenceSet.py rename to psyneulink/globals/preferences/mechanismpreferenceset.py index 83fdd33452e..6a107772b05 100644 --- a/PsyNeuLink/Globals/Preferences/MechanismPreferenceSet.py +++ b/psyneulink/globals/preferences/mechanismpreferenceset.py @@ -12,10 +12,10 @@ import inspect -from PsyNeuLink.Globals.Keywords import NAME -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import ComponentPreferenceSet, kpReportOutputPref, kpRuntimeParamStickyAssignmentPref, kpVerbosePref -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceEntry, PreferenceLevel -from PsyNeuLink.Globals.Utilities import Modulation +from psyneulink.globals.keywords import NAME +from psyneulink.globals.preferences.componentpreferenceset import ComponentPreferenceSet, kpReportOutputPref, kpRuntimeParamStickyAssignmentPref, kpVerbosePref +from psyneulink.globals.preferences.preferenceset import PreferenceEntry, PreferenceLevel +from psyneulink.globals.utilities import Modulation # MODIFIED 11/29/16 OLD: # # Keypaths for preferences: diff --git a/PsyNeuLink/Globals/Preferences/PreferenceSet.py b/psyneulink/globals/preferences/preferenceset.py similarity index 98% rename from PsyNeuLink/Globals/Preferences/PreferenceSet.py rename to psyneulink/globals/preferences/preferenceset.py index 8d52c332f74..4d846c32ea5 100644 --- a/PsyNeuLink/Globals/Preferences/PreferenceSet.py +++ b/psyneulink/globals/preferences/preferenceset.py @@ -12,8 +12,8 @@ from collections import namedtuple from enum import Enum, IntEnum -from PsyNeuLink.Globals.Keywords import kwPreferenceSetName -from PsyNeuLink.Globals.Utilities import iscompatible, kwCompatibilityType +from psyneulink.globals.keywords import kwPreferenceSetName +from psyneulink.globals.utilities import iscompatible, kwCompatibilityType PreferenceSetRegistry = {} @@ -234,7 +234,7 @@ def __init__(self, #region REGISTER # FIX: MAKE SURE THIS MAKES SENSE - from PsyNeuLink.Globals.Registry import register_category + from psyneulink.globals.registry import register_category register_category(entry=self, base_class=PreferenceSet, name=name, @@ -606,7 +606,7 @@ def validate_log(self, candidate_log_item, pref_set): :return: """ candidate_log_class = type(candidate_log_item) - from PsyNeuLink.Globals.Log import LogEntry + from psyneulink.globals.log import LogEntry # Candidate_log_item must be from a LogEntry declared in the same module as the owner of the preference # unless it is for the DefaultPeferenceSetOwner (which is used by many classes), @@ -686,7 +686,7 @@ def get_pref_setting_for_level(self, pref_ivar_name, requested_level=None): # If classPreferences for level have not yet been assigned as PreferenceSet, assign them if (not hasattr(next_level, 'classPreferences') or not isinstance(next_level.classPreferences, PreferenceSet)): - from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import ComponentPreferenceSet + from psyneulink.globals.preferences.componentpreferenceset import ComponentPreferenceSet ComponentPreferenceSet(owner=next_level, level=next_level.classPreferenceLevel) # MODIFIED ~4/30/17 END return_val = next_level.classPreferences.get_pref_setting_for_level(pref_ivar_name, requested_level) @@ -720,7 +720,7 @@ def get_pref_setting_for_level(self, pref_ivar_name, requested_level=None): # If requested level is higher than current one: if requested_level > self.owner.classPreferenceLevel: # Call class at next level - from PsyNeuLink.Components.Component import Component + from psyneulink.components.component import Component # THis is needed to skip ShellClass, which has no classPreferences, to get to Function (System) level if 'ShellClass' in repr(self.owner.__bases__[0]): try: @@ -747,7 +747,7 @@ def get_pref_setting_for_level(self, pref_ivar_name, requested_level=None): next_level = self.owner.__bases__[0] if (not hasattr(next_level, 'classPreferences') or not isinstance(next_level.classPreferences, PreferenceSet)): - from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import ComponentPreferenceSet + from psyneulink.globals.preferences.componentpreferenceset import ComponentPreferenceSet ComponentPreferenceSet(owner=next_level, level=next_level.classPreferenceLevel) # MODIFIED 5/2/17 END return_val = self.owner.__bases__[0].classPreferences.get_pref_setting_for_level(pref_ivar_name, @@ -783,7 +783,7 @@ def show(self, type=None): for pref_name in pref_names_sorted: if '_pref' in pref_name: - from PsyNeuLink.Globals.Utilities import get_modulationOperation_name + from psyneulink.globals.utilities import get_modulationOperation_name # GET TABLE INFO # Get base_value of pref diff --git a/PsyNeuLink/Globals/Registry.py b/psyneulink/globals/registry.py similarity index 98% rename from PsyNeuLink/Globals/Registry.py rename to psyneulink/globals/registry.py index e057979159b..06e1fc94bda 100644 --- a/PsyNeuLink/Globals/Registry.py +++ b/psyneulink/globals/registry.py @@ -11,7 +11,7 @@ from collections import namedtuple -from PsyNeuLink.Globals.Keywords import CONTROL_PROJECTION, DDM_MECHANISM, GATING_SIGNAL, INPUT_STATE, MAPPING_PROJECTION, OUTPUT_STATE, PARAMETER_STATE, kwComponentCategory, kwComponentPreferenceSet, kwMechanismComponentCategory, kwPreferenceSet, kwProcessComponentCategory, kwProjectionComponentCategory, kwStateComponentCategory, kwSystemComponentCategory +from psyneulink.globals.keywords import CONTROL_PROJECTION, DDM_MECHANISM, GATING_SIGNAL, INPUT_STATE, MAPPING_PROJECTION, OUTPUT_STATE, PARAMETER_STATE, kwComponentCategory, kwComponentPreferenceSet, kwMechanismComponentCategory, kwPreferenceSet, kwProcessComponentCategory, kwProjectionComponentCategory, kwStateComponentCategory, kwSystemComponentCategory # IMPLEMENTATION NOTE: # - Implement Registry as class, and each Registry as subclass @@ -101,8 +101,8 @@ def register_category(entry, :return: """ - from PsyNeuLink.Components.Component import Component - from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceSet + from psyneulink.components.component import Component + from psyneulink.globals.preferences.preferenceset import PreferenceSet if not issubclass(base_class, (Component, PreferenceSet)): raise RegistryError("base_class ({0}) for registry must be a subclass of " "Component or PreferenceSet".format(base_class)) diff --git a/PsyNeuLink/Globals/Run.py b/psyneulink/globals/run.py similarity index 99% rename from PsyNeuLink/Globals/Run.py rename to psyneulink/globals/run.py index 4240424f937..79fe65283ca 100644 --- a/PsyNeuLink/Globals/Run.py +++ b/psyneulink/globals/run.py @@ -300,12 +300,12 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Component import ExecutionStatus, function_type -from PsyNeuLink.Components.Process import ProcessInputState -from PsyNeuLink.Components.ShellClasses import Mechanism, Process, System -from PsyNeuLink.Globals.Keywords import EVC_SIMULATION, MECHANISM, PROCESS, PROCESSES_DIM, RUN, SAMPLE, SYSTEM, TARGET -from PsyNeuLink.Globals.Utilities import append_type_to_name, iscompatible -from PsyNeuLink.Scheduling.TimeScale import CentralClock, TimeScale +from psyneulink.components.component import ExecutionStatus, function_type +from psyneulink.components.process import ProcessInputState +from psyneulink.components.shellclasses import Mechanism, Process, System +from psyneulink.globals.keywords import EVC_SIMULATION, MECHANISM, PROCESS, PROCESSES_DIM, RUN, SAMPLE, SYSTEM, TARGET +from psyneulink.globals.utilities import append_type_to_name, iscompatible +from psyneulink.scheduling.timescale import CentralClock, TimeScale HOMOGENOUS = 1 HETEROGENOUS = 0 @@ -509,7 +509,7 @@ def run(object, # SET LEARNING_RATE, if specified, for all learningProjections in process or system if object.learning_rate is not None: - from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection + from psyneulink.components.projections.modulatory.learningprojection import LearningProjection for learning_mech in object.learning_mechanisms.mechanisms: for projection in learning_mech.output_state.efferents: if isinstance(projection, LearningProjection): diff --git a/PsyNeuLink/Globals/Utilities.py b/psyneulink/globals/utilities.py similarity index 99% rename from PsyNeuLink/Globals/Utilities.py rename to psyneulink/globals/utilities.py index aec86e894f7..d8ffeb9082b 100644 --- a/PsyNeuLink/Globals/Utilities.py +++ b/psyneulink/globals/utilities.py @@ -77,7 +77,7 @@ import numpy as np -from PsyNeuLink.Globals.Keywords import DISTANCE_METRICS, MATRIX_KEYWORD_VALUES, NAME, VALUE +from psyneulink.globals.keywords import DISTANCE_METRICS, MATRIX_KEYWORD_VALUES, NAME, VALUE # THE FOLLOWING CAUSES ALL WARNINGS TO GENERATE AN EXCEPTION: warnings.filterwarnings("error") @@ -191,9 +191,9 @@ def parameter_spec(param): # if isinstance(param, property): # param = ?? # if is_numeric(param): - from PsyNeuLink.Components.Functions.Function import function_type - from PsyNeuLink.Components.ShellClasses import Projection - from PsyNeuLink.Components.Component import parameter_keywords + from psyneulink.components.functions.function import function_type + from psyneulink.components.shellclasses import Projection + from psyneulink.components.component import parameter_keywords if (isinstance(param, (numbers.Number, np.ndarray, @@ -927,7 +927,7 @@ def is_same_function_spec(fct_spec_1, fct_spec_2): Arguments can be either a class or instance of a PsyNeuLink Function, or any other callable method or function Return True only if both are instances or classes of a PsyNeuLink Function; otherwise, return False """ - from PsyNeuLink.Components.Functions.Function import Function + from psyneulink.components.functions.function import Function def _convert_to_type(fct): if isinstance(fct, Function): diff --git a/PsyNeuLink/Library/Mechanisms/AdaptiveMechanisms/ControlMechanisms/__init__.py b/psyneulink/library/__init__.py similarity index 100% rename from PsyNeuLink/Library/Mechanisms/AdaptiveMechanisms/ControlMechanisms/__init__.py rename to psyneulink/library/__init__.py diff --git a/PsyNeuLink/Library/Mechanisms/AdaptiveMechanisms/__init__.py b/psyneulink/library/mechanisms/__init__.py similarity index 100% rename from PsyNeuLink/Library/Mechanisms/AdaptiveMechanisms/__init__.py rename to psyneulink/library/mechanisms/__init__.py diff --git a/PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/IntegratorMechanisms/__init__.py b/psyneulink/library/mechanisms/adaptive/__init__.py similarity index 100% rename from PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/IntegratorMechanisms/__init__.py rename to psyneulink/library/mechanisms/adaptive/__init__.py diff --git a/PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/ObjectiveMechanisms/__init__.py b/psyneulink/library/mechanisms/adaptive/control/__init__.py similarity index 100% rename from PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/ObjectiveMechanisms/__init__.py rename to psyneulink/library/mechanisms/adaptive/control/__init__.py diff --git a/PsyNeuLink/Library/Mechanisms/AdaptiveMechanisms/ControlMechanisms/LCMechanism.py b/psyneulink/library/mechanisms/adaptive/control/lcmechanism.py similarity index 97% rename from PsyNeuLink/Library/Mechanisms/AdaptiveMechanisms/ControlMechanisms/LCMechanism.py rename to psyneulink/library/mechanisms/adaptive/control/lcmechanism.py index e52dcf93bb6..2dc0efe5c37 100644 --- a/PsyNeuLink/Library/Mechanisms/AdaptiveMechanisms/ControlMechanisms/LCMechanism.py +++ b/psyneulink/library/mechanisms/adaptive/control/lcmechanism.py @@ -226,15 +226,15 @@ """ import typecheck as tc -from PsyNeuLink.Components.Functions.Function import Integrator, MULTIPLICATIVE_PARAM, ModulationParam, _is_modulation_param -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.AdaptiveMechanism import AdaptiveMechanism_Base -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.ControlMechanism.ControlMechanism import ControlMechanism -from PsyNeuLink.Components.ShellClasses import Mechanism -from PsyNeuLink.Globals.Defaults import defaultControlAllocation -from PsyNeuLink.Globals.Keywords import ALL, CONTROL_PROJECTIONS, CONTROL_SIGNALS, FUNCTION, INIT__EXECUTE__METHOD_ONLY, INPUT_STATES -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Scheduling.TimeScale import CentralClock, TimeScale +from psyneulink.components.functions.function import Integrator, MULTIPLICATIVE_PARAM, ModulationParam, _is_modulation_param +from psyneulink.components.mechanisms.adaptive.adaptivemechanism import AdaptiveMechanism_Base +from psyneulink.components.mechanisms.adaptive.control.controlmechanism import ControlMechanism +from psyneulink.components.shellclasses import Mechanism +from psyneulink.globals.defaults import defaultControlAllocation +from psyneulink.globals.keywords import ALL, CONTROL_PROJECTIONS, CONTROL_SIGNALS, FUNCTION, INIT__EXECUTE__METHOD_ONLY, INPUT_STATES +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.scheduling.timescale import CentralClock, TimeScale MODULATED_MECHANISMS = 'modulated_mechanisms' CONTROL_SIGNAL_NAME = 'LCMechanism_ControlSignal' @@ -492,7 +492,7 @@ def _instantiate_output_states(self, context=None): Returns ControlSignal (OutputState) """ - from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ProcessingMechanism import ProcessingMechanism_Base + from psyneulink.components.mechanisms.processing.processingmechanism import ProcessingMechanism_Base # *ALL* is specified for modulated_mechanisms: # assign all Processing Mechanisms in the LCMechanism's Composition(s) to its modulated_mechanisms attribute diff --git a/PsyNeuLink/Library/Mechanisms/AdaptiveMechanisms/LearningMechanisms/AutoAssociativeLearningMechanism.py b/psyneulink/library/mechanisms/adaptive/learning/autoassociativelearningmechanism.py similarity index 95% rename from PsyNeuLink/Library/Mechanisms/AdaptiveMechanisms/LearningMechanisms/AutoAssociativeLearningMechanism.py rename to psyneulink/library/mechanisms/adaptive/learning/autoassociativelearningmechanism.py index 874559c09e9..4fd7d51ea32 100644 --- a/PsyNeuLink/Library/Mechanisms/AdaptiveMechanisms/LearningMechanisms/AutoAssociativeLearningMechanism.py +++ b/psyneulink/library/mechanisms/adaptive/learning/autoassociativelearningmechanism.py @@ -77,18 +77,18 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Component import parameter_keywords -from PsyNeuLink.Components.Functions.Function import Hebbian, ModulationParam, _is_modulation_param, is_function_type -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.LearningMechanism.LearningMechanism import ACTIVATION_INPUT, LearningMechanism -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ObjectiveMechanism import ObjectiveMechanism -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.Projections.Projection import Projection_Base, _is_projection_spec, _validate_receiver, projection_keywords -from PsyNeuLink.Components.ShellClasses import Projection -from PsyNeuLink.Globals.Keywords import AUTOASSOCIATIVE_LEARNING_MECHANISM, CONTROL_PROJECTIONS, FUNCTION_PARAMS, INDEX, INITIALIZING, INPUT_STATES, LEARNING, LEARNING_PROJECTION, LEARNING_SIGNAL, LEARNING_SIGNALS, MAPPING_PROJECTION, MATRIX, NAME, OUTPUT_STATES, PROJECTION -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Globals.Utilities import is_numeric, parameter_spec -from PsyNeuLink.Scheduling.TimeScale import CentralClock, TimeScale +from psyneulink.components.component import parameter_keywords +from psyneulink.components.functions.function import Hebbian, ModulationParam, _is_modulation_param, is_function_type +from psyneulink.components.mechanisms.adaptive.learning.learningmechanism import ACTIVATION_INPUT, LearningMechanism +from psyneulink.components.mechanisms.processing.objectivemechanism import ObjectiveMechanism +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.projections.projection import Projection_Base, _is_projection_spec, _validate_receiver, projection_keywords +from psyneulink.components.shellclasses import Projection +from psyneulink.globals.keywords import AUTOASSOCIATIVE_LEARNING_MECHANISM, CONTROL_PROJECTIONS, FUNCTION_PARAMS, INDEX, INITIALIZING, INPUT_STATES, LEARNING, LEARNING_PROJECTION, LEARNING_SIGNAL, LEARNING_SIGNALS, MAPPING_PROJECTION, MATRIX, NAME, OUTPUT_STATES, PROJECTION +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.globals.utilities import is_numeric, parameter_spec +from psyneulink.scheduling.timescale import CentralClock, TimeScale # Params: @@ -365,10 +365,10 @@ def _validate_params(self, request_set, target_set=None, context=None): # FIX: REPLACE WITH CALL TO _parse_state_spec WITH APPROPRIATE PARAMETERS (AKIN TO CONTROL_SIGNAL if LEARNING_SIGNALS in target_set and target_set[LEARNING_SIGNALS]: - from PsyNeuLink.Components.States.ModulatorySignals.LearningSignal \ + from psyneulink.components.states.modulatorysignals.learningsignal \ import LearningSignal - from PsyNeuLink.Components.States.ParameterState import ParameterState - from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection + from psyneulink.components.states.parameterstate import ParameterState + from psyneulink.components.projections.modulatory.learningprojection import LearningProjection for spec in target_set[LEARNING_SIGNALS]: @@ -489,9 +489,9 @@ def _instantiate_attributes_before_function(self, context=None): def _instantiate_output_states(self, context=None): # Create registry for LearningSignals (to manage names) - from PsyNeuLink.Globals.Registry import register_category - from PsyNeuLink.Components.States.ModulatorySignals.LearningSignal import LearningSignal - from PsyNeuLink.Components.States.State import State_Base + from psyneulink.globals.registry import register_category + from psyneulink.components.states.modulatorysignals.learningsignal import LearningSignal + from psyneulink.components.states.state import State_Base register_category(entry=LearningSignal, base_class=State_Base, registry=self._stateRegistry, diff --git a/PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/TransferMechanisms/__init__.py b/psyneulink/library/mechanisms/processing/__init__.py similarity index 100% rename from PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/TransferMechanisms/__init__.py rename to psyneulink/library/mechanisms/processing/__init__.py diff --git a/PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/__init__.py b/psyneulink/library/mechanisms/processing/integrator/__init__.py similarity index 100% rename from PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/__init__.py rename to psyneulink/library/mechanisms/processing/integrator/__init__.py diff --git a/PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/IntegratorMechanisms/DDM.py b/psyneulink/library/mechanisms/processing/integrator/ddm.py similarity index 98% rename from PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/IntegratorMechanisms/DDM.py rename to psyneulink/library/mechanisms/processing/integrator/ddm.py index a1da8bb2f12..e6bf396e3e1 100644 --- a/PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/IntegratorMechanisms/DDM.py +++ b/psyneulink/library/mechanisms/processing/integrator/ddm.py @@ -291,15 +291,15 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Component import method_type -from PsyNeuLink.Components.Functions.Function import BogaczEtAl, DriftDiffusionIntegrator, Integrator, NF_Results, NavarroAndFuss, STARTING_POINT, THRESHOLD -from PsyNeuLink.Components.Mechanisms.Mechanism import Mechanism_Base -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ProcessingMechanism import ProcessingMechanism_Base -from PsyNeuLink.Components.States.OutputState import SEQUENTIAL -from PsyNeuLink.Globals.Keywords import FUNCTION, FUNCTION_PARAMS, INITIALIZING, NAME, OUTPUT_STATES, TIME_SCALE, kwPreferenceSetName -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set, kpReportOutputPref -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceEntry, PreferenceLevel -from PsyNeuLink.Scheduling.TimeScale import CentralClock, TimeScale +from psyneulink.components.component import method_type +from psyneulink.components.functions.function import BogaczEtAl, DriftDiffusionIntegrator, Integrator, NF_Results, NavarroAndFuss, STARTING_POINT, THRESHOLD +from psyneulink.components.mechanisms.mechanism import Mechanism_Base +from psyneulink.components.mechanisms.processing.processingmechanism import ProcessingMechanism_Base +from psyneulink.components.states.outputstate import SEQUENTIAL +from psyneulink.globals.keywords import FUNCTION, FUNCTION_PARAMS, INITIALIZING, NAME, OUTPUT_STATES, TIME_SCALE, kwPreferenceSetName +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set, kpReportOutputPref +from psyneulink.globals.preferences.preferenceset import PreferenceEntry, PreferenceLevel +from psyneulink.scheduling.timescale import CentralClock, TimeScale logger = logging.getLogger(__name__) @@ -653,7 +653,7 @@ def __init__(self, # self.size = size self.threshold = thresh - from PsyNeuLink.Components.States.OutputState import StandardOutputStates + from psyneulink.components.states.outputstate import StandardOutputStates self.standard_output_states = StandardOutputStates(self, DDM_standard_output_states, SEQUENTIAL) super(DDM, self).__init__(variable=default_variable, diff --git a/PsyNeuLink/Library/Mechanisms/__init__.py b/psyneulink/library/mechanisms/processing/objective/__init__.py similarity index 100% rename from PsyNeuLink/Library/Mechanisms/__init__.py rename to psyneulink/library/mechanisms/processing/objective/__init__.py diff --git a/PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/ObjectiveMechanisms/ComparatorMechanism.py b/psyneulink/library/mechanisms/processing/objective/comparatormechanism.py similarity index 96% rename from PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/ObjectiveMechanisms/ComparatorMechanism.py rename to psyneulink/library/mechanisms/processing/objective/comparatormechanism.py index 089d36d64d1..838632bf2ac 100644 --- a/PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/ObjectiveMechanisms/ComparatorMechanism.py +++ b/psyneulink/library/mechanisms/processing/objective/comparatormechanism.py @@ -127,17 +127,17 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Functions.Function import LinearCombination -from PsyNeuLink.Components.Mechanisms.Mechanism import Mechanism_Base -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ObjectiveMechanism import MONITORED_OUTPUT_STATES, OUTCOME, ObjectiveMechanism -from PsyNeuLink.Components.ShellClasses import Mechanism -from PsyNeuLink.Components.States.InputState import InputState -from PsyNeuLink.Components.States.OutputState import OutputState, PRIMARY_OUTPUT_STATE, StandardOutputStates -from PsyNeuLink.Globals.Keywords import CALCULATE, COMPARATOR_MECHANISM, INPUT_STATES, NAME, SAMPLE, TARGET, TIME_SCALE, VARIABLE, kwPreferenceSetName -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set, kpReportOutputPref -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceEntry, PreferenceLevel -from PsyNeuLink.Globals.Utilities import is_numeric, is_value_spec, iscompatible, kwCompatibilityLength, kwCompatibilityNumeric -from PsyNeuLink.Scheduling.TimeScale import TimeScale +from psyneulink.components.functions.function import LinearCombination +from psyneulink.components.mechanisms.mechanism import Mechanism_Base +from psyneulink.components.mechanisms.processing.objectivemechanism import MONITORED_OUTPUT_STATES, OUTCOME, ObjectiveMechanism +from psyneulink.components.shellclasses import Mechanism +from psyneulink.components.states.inputstate import InputState +from psyneulink.components.states.outputstate import OutputState, PRIMARY_OUTPUT_STATE, StandardOutputStates +from psyneulink.globals.keywords import CALCULATE, COMPARATOR_MECHANISM, INPUT_STATES, NAME, SAMPLE, TARGET, TIME_SCALE, VARIABLE, kwPreferenceSetName +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set, kpReportOutputPref +from psyneulink.globals.preferences.preferenceset import PreferenceEntry, PreferenceLevel +from psyneulink.globals.utilities import is_numeric, is_value_spec, iscompatible, kwCompatibilityLength, kwCompatibilityNumeric +from psyneulink.scheduling.timescale import TimeScale SSE = 'SSE' MSE = 'MSE' @@ -336,7 +336,7 @@ def __init__(self, # Parse items of input_states arg for validation (in _validate_params) input_states = input_states or [None] * 2 - from PsyNeuLink.Components.States.State import _parse_state_spec + from psyneulink.components.states.state import _parse_state_spec sample_input = _parse_state_spec(owner=self, state_type=InputState, state_spec=input_states[0], diff --git a/PsyNeuLink/Library/Projections/PathwayProjections/__init__.py b/psyneulink/library/mechanisms/processing/transfer/__init__.py similarity index 100% rename from PsyNeuLink/Library/Projections/PathwayProjections/__init__.py rename to psyneulink/library/mechanisms/processing/transfer/__init__.py diff --git a/PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/TransferMechanisms/KWTA.py b/psyneulink/library/mechanisms/processing/transfer/kwta.py similarity index 98% rename from PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/TransferMechanisms/KWTA.py rename to psyneulink/library/mechanisms/processing/transfer/kwta.py index c1665a90a61..942ac459e94 100644 --- a/PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/TransferMechanisms/KWTA.py +++ b/psyneulink/library/mechanisms/processing/transfer/kwta.py @@ -155,13 +155,13 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Functions.Function import Logistic -from PsyNeuLink.Globals.Keywords import INITIALIZING, KWTA, K_VALUE, RATIO, RESULT, THRESHOLD -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Utilities import is_numeric_or_none -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.TransferMechanisms.RecurrentTransferMechanism import RecurrentTransferMechanism -from PsyNeuLink.Library.Projections.PathwayProjections.AutoAssociativeProjection import AutoAssociativeProjection -from PsyNeuLink.Scheduling.TimeScale import CentralClock, TimeScale +from psyneulink.components.functions.function import Logistic +from psyneulink.globals.keywords import INITIALIZING, KWTA, K_VALUE, RATIO, RESULT, THRESHOLD +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.utilities import is_numeric_or_none +from psyneulink.library.mechanisms.processing.transfer.recurrenttransfermechanism import RecurrentTransferMechanism +from psyneulink.library.projections.pathway.autoassociativeprojection import AutoAssociativeProjection +from psyneulink.scheduling.timescale import CentralClock, TimeScale logger = logging.getLogger(__name__) diff --git a/PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/TransferMechanisms/LCA.py b/psyneulink/library/mechanisms/processing/transfer/lca.py similarity index 97% rename from PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/TransferMechanisms/LCA.py rename to psyneulink/library/mechanisms/processing/transfer/lca.py index 765cf531a81..e33bb5364e3 100644 --- a/PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/TransferMechanisms/LCA.py +++ b/psyneulink/library/mechanisms/processing/transfer/lca.py @@ -79,14 +79,13 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Functions.Function import Logistic, max_vs_avg, max_vs_next -from PsyNeuLink.Components.States.OutputState import PRIMARY_OUTPUT_STATE, StandardOutputStates -from PsyNeuLink.Globals.Keywords import BETA, INITIALIZER, NOISE, RATE, CALCULATE, ENERGY, ENTROPY, INITIALIZING, LCA, MEAN, MEDIAN, NAME, RESULT, STANDARD_DEVIATION, VARIANCE -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Utilities import is_numeric_or_none -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.TransferMechanisms.RecurrentTransferMechanism import RecurrentTransferMechanism -from PsyNeuLink.Components.Functions.Function import LCAIntegrator -from PsyNeuLink.Scheduling.TimeScale import TimeScale +from psyneulink.components.functions.function import LCAIntegrator, Logistic, max_vs_avg, max_vs_next +from psyneulink.components.states.outputstate import PRIMARY_OUTPUT_STATE, StandardOutputStates +from psyneulink.globals.keywords import BETA, CALCULATE, ENERGY, ENTROPY, INITIALIZER, INITIALIZING, LCA, MEAN, MEDIAN, NAME, NOISE, RATE, RESULT, STANDARD_DEVIATION, VARIANCE +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.utilities import is_numeric_or_none +from psyneulink.library.mechanisms.processing.transfer.recurrenttransfermechanism import RecurrentTransferMechanism +from psyneulink.scheduling.timescale import TimeScale class LCAError(Exception): @@ -573,4 +572,4 @@ def inhibition(self): @inhibition.setter def inhibition(self, setting): - self.hetero = setting \ No newline at end of file + self.hetero = setting diff --git a/PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/TransferMechanisms/RecurrentTransferMechanism.py b/psyneulink/library/mechanisms/processing/transfer/recurrenttransfermechanism.py similarity index 97% rename from PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/TransferMechanisms/RecurrentTransferMechanism.py rename to psyneulink/library/mechanisms/processing/transfer/recurrenttransfermechanism.py index 064852514ac..d7980b42a82 100644 --- a/PsyNeuLink/Library/Mechanisms/ProcessingMechanisms/TransferMechanisms/RecurrentTransferMechanism.py +++ b/psyneulink/library/mechanisms/processing/transfer/recurrenttransfermechanism.py @@ -131,21 +131,21 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Functions.Function import Hebbian, Linear, Stability, get_matrix, is_function_type -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.LearningMechanism.LearningMechanism import ACTIVATION_INPUT, LEARNING_SIGNAL, LearningMechanism -from PsyNeuLink.Components.Mechanisms.Mechanism import Mechanism_Base -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.States.OutputState import PRIMARY_OUTPUT_STATE, StandardOutputStates -from PsyNeuLink.Components.States.ParameterState import ParameterState -from PsyNeuLink.Components.States.State import _instantiate_state -from PsyNeuLink.Globals.Keywords import AUTO, COMMAND_LINE, ENERGY, ENTROPY, FULL_CONNECTIVITY_MATRIX, HETERO, INITIALIZING, MATRIX, MEAN, MEDIAN, NAME, PARAMS_CURRENT, RECURRENT_TRANSFER_MECHANISM, RESULT, SET_ATTRIBUTE, STANDARD_DEVIATION, VARIANCE -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Utilities import is_numeric_or_none, parameter_spec -from PsyNeuLink.Library.Mechanisms.AdaptiveMechanisms.LearningMechanisms.AutoAssociativeLearningMechanism import AutoAssociativeLearningMechanism -from PsyNeuLink.Library.Projections.PathwayProjections.AutoAssociativeProjection import AutoAssociativeProjection, get_auto_matrix, get_hetero_matrix -from PsyNeuLink.Scheduling.TimeScale import CentralClock, TimeScale +from psyneulink.components.functions.function import Hebbian, Linear, Stability, get_matrix, is_function_type +from psyneulink.components.mechanisms.adaptive.learning.learningmechanism import ACTIVATION_INPUT, LEARNING_SIGNAL, LearningMechanism +from psyneulink.components.mechanisms.mechanism import Mechanism_Base +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.projections.modulatory.learningprojection import LearningProjection +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.states.outputstate import PRIMARY_OUTPUT_STATE, StandardOutputStates +from psyneulink.components.states.parameterstate import ParameterState +from psyneulink.components.states.state import _instantiate_state +from psyneulink.globals.keywords import AUTO, COMMAND_LINE, ENERGY, ENTROPY, FULL_CONNECTIVITY_MATRIX, HETERO, INITIALIZING, MATRIX, MEAN, MEDIAN, NAME, PARAMS_CURRENT, RECURRENT_TRANSFER_MECHANISM, RESULT, SET_ATTRIBUTE, STANDARD_DEVIATION, VARIANCE +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.utilities import is_numeric_or_none, parameter_spec +from psyneulink.library.mechanisms.adaptive.learning.autoassociativelearningmechanism import AutoAssociativeLearningMechanism +from psyneulink.library.projections.pathway.autoassociativeprojection import AutoAssociativeProjection, get_auto_matrix, get_hetero_matrix +from psyneulink.scheduling.timescale import CentralClock, TimeScale class RecurrentTransferError(Exception): diff --git a/PsyNeuLink/Library/Projections/__init__.py b/psyneulink/library/projections/__init__.py similarity index 100% rename from PsyNeuLink/Library/Projections/__init__.py rename to psyneulink/library/projections/__init__.py diff --git a/PsyNeuLink/Library/Subsystems/AGT/__init__.py b/psyneulink/library/projections/pathway/__init__.py similarity index 100% rename from PsyNeuLink/Library/Subsystems/AGT/__init__.py rename to psyneulink/library/projections/pathway/__init__.py diff --git a/PsyNeuLink/Library/Projections/PathwayProjections/AutoAssociativeProjection.py b/psyneulink/library/projections/pathway/autoassociativeprojection.py similarity index 97% rename from PsyNeuLink/Library/Projections/PathwayProjections/AutoAssociativeProjection.py rename to psyneulink/library/projections/pathway/autoassociativeprojection.py index 34ac7b9a56d..f1b866e5106 100644 --- a/PsyNeuLink/Library/Projections/PathwayProjections/AutoAssociativeProjection.py +++ b/psyneulink/library/projections/pathway/autoassociativeprojection.py @@ -86,16 +86,16 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Component import parameter_keywords -from PsyNeuLink.Components.Functions.Function import get_matrix -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.Projections.Projection import projection_keywords -from PsyNeuLink.Components.ShellClasses import Mechanism -from PsyNeuLink.Components.States.OutputState import OutputState -from PsyNeuLink.Globals.Keywords import AUTO, AUTO_ASSOCIATIVE_PROJECTION, DEFAULT_MATRIX, HETERO, HOLLOW_MATRIX, INITIALIZING, MATRIX -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Scheduling.TimeScale import CentralClock, TimeScale +from psyneulink.components.component import parameter_keywords +from psyneulink.components.functions.function import get_matrix +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.projections.projection import projection_keywords +from psyneulink.components.shellclasses import Mechanism +from psyneulink.components.states.outputstate import OutputState +from psyneulink.globals.keywords import AUTO, AUTO_ASSOCIATIVE_PROJECTION, DEFAULT_MATRIX, HETERO, HOLLOW_MATRIX, INITIALIZING, MATRIX +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.scheduling.timescale import CentralClock, TimeScale parameter_keywords.update({AUTO_ASSOCIATIVE_PROJECTION}) projection_keywords.update({AUTO_ASSOCIATIVE_PROJECTION}) diff --git a/PsyNeuLink/Library/Subsystems/EVC/__init__.py b/psyneulink/library/subsystems/__init__.py similarity index 100% rename from PsyNeuLink/Library/Subsystems/EVC/__init__.py rename to psyneulink/library/subsystems/__init__.py diff --git a/PsyNeuLink/Library/Subsystems/__init__.py b/psyneulink/library/subsystems/agt/__init__.py similarity index 100% rename from PsyNeuLink/Library/Subsystems/__init__.py rename to psyneulink/library/subsystems/agt/__init__.py diff --git a/PsyNeuLink/Library/Subsystems/AGT/AGTControlMechanism.py b/psyneulink/library/subsystems/agt/agtcontrolmechanism.py similarity index 96% rename from PsyNeuLink/Library/Subsystems/AGT/AGTControlMechanism.py rename to psyneulink/library/subsystems/agt/agtcontrolmechanism.py index d45302465a3..39733030b84 100644 --- a/PsyNeuLink/Library/Subsystems/AGT/AGTControlMechanism.py +++ b/psyneulink/library/subsystems/agt/agtcontrolmechanism.py @@ -119,17 +119,17 @@ """ import typecheck as tc -from PsyNeuLink.Components.Functions.Function import AGTUtilityIntegrator, ModulationParam, _is_modulation_param -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.AdaptiveMechanism import AdaptiveMechanism_Base -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.ControlMechanism.ControlMechanism import ControlMechanism -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ObjectiveMechanism import MonitoredOutputStatesOption, ObjectiveMechanism, _parse_monitored_output_states -from PsyNeuLink.Components.ShellClasses import Mechanism, System -from PsyNeuLink.Components.States.OutputState import OutputState -from PsyNeuLink.Globals.Defaults import defaultControlAllocation -from PsyNeuLink.Globals.Keywords import CONTROL, CONTROL_PROJECTIONS, CONTROL_SIGNALS, INIT__EXECUTE__METHOD_ONLY, MECHANISM, OBJECTIVE_MECHANISM -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Scheduling.TimeScale import CentralClock, TimeScale +from psyneulink.components.functions.function import AGTUtilityIntegrator, ModulationParam, _is_modulation_param +from psyneulink.components.mechanisms.adaptive.adaptivemechanism import AdaptiveMechanism_Base +from psyneulink.components.mechanisms.adaptive.control.controlmechanism import ControlMechanism +from psyneulink.components.mechanisms.processing.objectivemechanism import MonitoredOutputStatesOption, ObjectiveMechanism, _parse_monitored_output_states +from psyneulink.components.shellclasses import Mechanism, System +from psyneulink.components.states.outputstate import OutputState +from psyneulink.globals.defaults import defaultControlAllocation +from psyneulink.globals.keywords import CONTROL, CONTROL_PROJECTIONS, CONTROL_SIGNALS, INIT__EXECUTE__METHOD_ONLY, MECHANISM, OBJECTIVE_MECHANISM +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.scheduling.timescale import CentralClock, TimeScale MONITORED_OUTPUT_STATES = 'monitored_output_states' MONITORED_OUTPUT_STATE_NAME_SUFFIX = '_Monitor' @@ -265,7 +265,7 @@ class ClassDefaults(AdaptiveMechanism_Base.ClassDefaults): # This must be a list, as there may be more than one (e.g., one per control_signal) variable = defaultControlAllocation - from PsyNeuLink.Components.Functions.Function import Linear + from psyneulink.components.functions.function import Linear paramClassDefaults = ControlMechanism.paramClassDefaults.copy() paramClassDefaults.update({CONTROL_SIGNALS: None, CONTROL_PROJECTIONS: None diff --git a/PsyNeuLink/Library/Subsystems/AGT/LCControlMechanism.py b/psyneulink/library/subsystems/agt/lccontrolmechanism.py similarity index 97% rename from PsyNeuLink/Library/Subsystems/AGT/LCControlMechanism.py rename to psyneulink/library/subsystems/agt/lccontrolmechanism.py index 1bffd05e722..e2311fd62d8 100644 --- a/PsyNeuLink/Library/Subsystems/AGT/LCControlMechanism.py +++ b/psyneulink/library/subsystems/agt/lccontrolmechanism.py @@ -328,17 +328,17 @@ """ import typecheck as tc -from PsyNeuLink.Components.Functions.Function import FHNIntegrator, MULTIPLICATIVE_PARAM, ModulationParam, _is_modulation_param -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.AdaptiveMechanism import AdaptiveMechanism_Base -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.ControlMechanism.ControlMechanism import ControlMechanism -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ObjectiveMechanism import ObjectiveMechanism -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection -from PsyNeuLink.Components.ShellClasses import Mechanism, System -from PsyNeuLink.Globals.Defaults import defaultControlAllocation -from PsyNeuLink.Globals.Keywords import ALL, CONTROL_PROJECTIONS, CONTROL_SIGNALS, FUNCTION, INIT__EXECUTE__METHOD_ONLY -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Scheduling.TimeScale import CentralClock, TimeScale +from psyneulink.components.functions.function import FHNIntegrator, MULTIPLICATIVE_PARAM, ModulationParam, _is_modulation_param +from psyneulink.components.mechanisms.adaptive.adaptivemechanism import AdaptiveMechanism_Base +from psyneulink.components.mechanisms.adaptive.control.controlmechanism import ControlMechanism +from psyneulink.components.mechanisms.processing.objectivemechanism import ObjectiveMechanism +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection +from psyneulink.components.shellclasses import Mechanism, System +from psyneulink.globals.defaults import defaultControlAllocation +from psyneulink.globals.keywords import ALL, CONTROL_PROJECTIONS, CONTROL_SIGNALS, FUNCTION, INIT__EXECUTE__METHOD_ONLY +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.scheduling.timescale import CentralClock, TimeScale MODULATED_MECHANISMS = 'modulated_mechanisms' CONTROL_SIGNAL_NAME = 'LCControlMechanism_ControlSignal' @@ -614,7 +614,7 @@ def _instantiate_output_states(self, context=None): Returns ControlSignal (OutputState) """ - from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ProcessingMechanism import ProcessingMechanism_Base + from psyneulink.components.mechanisms.processing.processingmechanism import ProcessingMechanism_Base # *ALL* is specified for modulated_mechanisms: # assign all Processing Mechanisms in the LCControlMechanism's Composition(s) to its modulated_mechanisms attribute diff --git a/PsyNeuLink/Library/__init__.py b/psyneulink/library/subsystems/evc/__init__.py similarity index 100% rename from PsyNeuLink/Library/__init__.py rename to psyneulink/library/subsystems/evc/__init__.py diff --git a/PsyNeuLink/Library/Subsystems/EVC/EVCAuxiliary.py b/psyneulink/library/subsystems/evc/evcauxiliary.py similarity index 98% rename from PsyNeuLink/Library/Subsystems/EVC/EVCAuxiliary.py rename to psyneulink/library/subsystems/evc/evcauxiliary.py index a0efd1fc271..a969532b2f7 100644 --- a/PsyNeuLink/Library/Subsystems/EVC/EVCAuxiliary.py +++ b/psyneulink/library/subsystems/evc/evcauxiliary.py @@ -16,12 +16,12 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Functions.Function import Function_Base -from PsyNeuLink.Globals.Defaults import MPI_IMPLEMENTATION, defaultControlAllocation -from PsyNeuLink.Globals.Keywords import CLOCK, COMBINE_OUTCOME_AND_COST_FUNCTION, CONTEXT, COST_FUNCTION, EVC_SIMULATION, EXECUTING, FUNCTION_OUTPUT_TYPE_CONVERSION, INITIALIZING, PARAMETER_STATE_PARAMS, PARAMS, SAVE_ALL_VALUES_AND_POLICIES, TIME_SCALE, VALUE_FUNCTION, VARIABLE, kwPreferenceSetName, kwProgressBarChar -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set, kpReportOutputPref, kpRuntimeParamStickyAssignmentPref -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceEntry, PreferenceLevel -from PsyNeuLink.Scheduling.TimeScale import CentralClock, TimeScale +from psyneulink.components.functions.function import Function_Base +from psyneulink.globals.defaults import MPI_IMPLEMENTATION, defaultControlAllocation +from psyneulink.globals.keywords import CLOCK, COMBINE_OUTCOME_AND_COST_FUNCTION, CONTEXT, COST_FUNCTION, EVC_SIMULATION, EXECUTING, FUNCTION_OUTPUT_TYPE_CONVERSION, INITIALIZING, PARAMETER_STATE_PARAMS, PARAMS, SAVE_ALL_VALUES_AND_POLICIES, TIME_SCALE, VALUE_FUNCTION, VARIABLE, kwPreferenceSetName, kwProgressBarChar +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set, kpReportOutputPref, kpRuntimeParamStickyAssignmentPref +from psyneulink.globals.preferences.preferenceset import PreferenceEntry, PreferenceLevel +from psyneulink.scheduling.timescale import CentralClock, TimeScale PY_MULTIPROCESSING = False @@ -175,7 +175,7 @@ def function(self, **kwargs): cost_function = controller.paramsCurrent[COST_FUNCTION] combine_function = controller.paramsCurrent[COMBINE_OUTCOME_AND_COST_FUNCTION] - from PsyNeuLink.Components.Functions.Function import UserDefinedFunction + from psyneulink.components.functions.function import UserDefinedFunction # Aggregate costs if isinstance(cost_function, UserDefinedFunction): diff --git a/PsyNeuLink/Library/Subsystems/EVC/EVCControlMechanism.py b/psyneulink/library/subsystems/evc/evccontrolmechanism.py similarity index 97% rename from PsyNeuLink/Library/Subsystems/EVC/EVCControlMechanism.py rename to psyneulink/library/subsystems/evc/evccontrolmechanism.py index 1346e32e9e4..925641b6999 100644 --- a/PsyNeuLink/Library/Subsystems/EVC/EVCControlMechanism.py +++ b/psyneulink/library/subsystems/evc/evccontrolmechanism.py @@ -320,21 +320,21 @@ import numpy as np import typecheck as tc -from PsyNeuLink.Components.Component import function_type -from PsyNeuLink.Components.Functions.Function import ModulationParam, _is_modulation_param -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.ControlMechanism.ControlMechanism import ControlMechanism -from PsyNeuLink.Components.Mechanisms.Mechanism import MechanismList -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms import IntegratorMechanism -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.ObjectiveMechanism import ObjectiveMechanism -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.ShellClasses import Function, System -from PsyNeuLink.Globals.Defaults import defaultControlAllocation -from PsyNeuLink.Globals.Keywords import CONTROL, COST_FUNCTION, EVC_MECHANISM, FUNCTION, INITIALIZING, INIT_FUNCTION_METHOD_ONLY, PARAMETER_STATES, PREDICTION_MECHANISM, PREDICTION_MECHANISM_PARAMS, PREDICTION_MECHANISM_TYPE, SUM -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import is_pref_set -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceLevel -from PsyNeuLink.Globals.Utilities import ContentAddressableList -from PsyNeuLink.Library.Subsystems.EVC.EVCAuxiliary import ControlSignalGridSearch, ValueFunction -from PsyNeuLink.Scheduling.TimeScale import CentralClock, Clock, TimeScale +from psyneulink.components.component import function_type +from psyneulink.components.functions.function import ModulationParam, _is_modulation_param +from psyneulink.components.mechanisms.adaptive.control.controlmechanism import ControlMechanism +from psyneulink.components.mechanisms.mechanism import MechanismList +from psyneulink.components.mechanisms.processing import integratormechanism +from psyneulink.components.mechanisms.processing.objectivemechanism import ObjectiveMechanism +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.shellclasses import Function, System +from psyneulink.globals.defaults import defaultControlAllocation +from psyneulink.globals.keywords import CONTROL, COST_FUNCTION, EVC_MECHANISM, FUNCTION, INITIALIZING, INIT_FUNCTION_METHOD_ONLY, PARAMETER_STATES, PREDICTION_MECHANISM, PREDICTION_MECHANISM_PARAMS, PREDICTION_MECHANISM_TYPE, SUM +from psyneulink.globals.preferences.componentpreferenceset import is_pref_set +from psyneulink.globals.preferences.preferenceset import PreferenceLevel +from psyneulink.globals.utilities import ContentAddressableList +from psyneulink.library.subsystems.evc.evcauxiliary import ControlSignalGridSearch, ValueFunction +from psyneulink.scheduling.timescale import CentralClock, Clock, TimeScale class EVCError(Exception): @@ -669,7 +669,7 @@ class ClassDefaults(ControlMechanism.ClassDefaults): # This must be a list, as there may be more than one (e.g., one per control_signal) variable = defaultControlAllocation - from PsyNeuLink.Components.Functions.Function import LinearCombination + from psyneulink.components.functions.function import LinearCombination # from Components.__init__ import DefaultSystem paramClassDefaults = ControlMechanism.paramClassDefaults.copy() paramClassDefaults.update({PARAMETER_STATES: NotImplemented}) # This suppresses parameterStates @@ -678,7 +678,7 @@ class ClassDefaults(ControlMechanism.ClassDefaults): def __init__(self, system:tc.optional(System)=None, objective_mechanism:tc.optional(tc.any(ObjectiveMechanism, list))=None, - prediction_mechanism_type=IntegratorMechanism.IntegratorMechanism, + prediction_mechanism_type=integratormechanism.IntegratorMechanism, prediction_mechanism_params:tc.optional(dict)=None, control_signals:tc.optional(list) = None, modulation:tc.optional(_is_modulation_param)=ModulationParam.MULTIPLICATIVE, @@ -1024,7 +1024,7 @@ def cost_function(self): @cost_function.setter def cost_function(self, value): - from PsyNeuLink.Components.Functions.Function import UserDefinedFunction + from psyneulink.components.functions.function import UserDefinedFunction if isinstance(value, function_type): udf = UserDefinedFunction(function=value) self._cost_function = udf @@ -1037,7 +1037,7 @@ def combine_outcome_and_cost_function(self): @combine_outcome_and_cost_function.setter def combine_outcome_and_cost_function(self, value): - from PsyNeuLink.Components.Functions.Function import UserDefinedFunction + from psyneulink.components.functions.function import UserDefinedFunction if isinstance(value, function_type): udf = UserDefinedFunction(function=value) self._combine_outcome_and_cost_function = udf diff --git a/PsyNeuLink/Scheduling/__init__.py b/psyneulink/scheduling/__init__.py similarity index 100% rename from PsyNeuLink/Scheduling/__init__.py rename to psyneulink/scheduling/__init__.py diff --git a/PsyNeuLink/Scheduling/Condition.py b/psyneulink/scheduling/condition.py similarity index 99% rename from PsyNeuLink/Scheduling/Condition.py rename to psyneulink/scheduling/condition.py index bb268bfe06f..b500d6b1b21 100644 --- a/PsyNeuLink/Scheduling/Condition.py +++ b/psyneulink/scheduling/condition.py @@ -319,7 +319,7 @@ def converge(mech, thresh): import logging -from PsyNeuLink.Scheduling.TimeScale import TimeScale +from psyneulink.scheduling.timescale import TimeScale logger = logging.getLogger(__name__) diff --git a/PsyNeuLink/Scheduling/Scheduler.py b/psyneulink/scheduling/scheduler.py similarity index 99% rename from PsyNeuLink/Scheduling/Scheduler.py rename to psyneulink/scheduling/scheduler.py index f1cbfe63852..ffa32e550c3 100644 --- a/PsyNeuLink/Scheduling/Scheduler.py +++ b/psyneulink/scheduling/scheduler.py @@ -277,8 +277,8 @@ from toposort import toposort -from PsyNeuLink.Scheduling.Condition import AllHaveRun, Always, ConditionSet, Never -from PsyNeuLink.Scheduling.TimeScale import TimeScale +from psyneulink.scheduling.condition import AllHaveRun, Always, ConditionSet, Never +from psyneulink.scheduling.timescale import TimeScale logger = logging.getLogger(__name__) diff --git a/PsyNeuLink/Scheduling/TimeScale.py b/psyneulink/scheduling/timescale.py similarity index 98% rename from PsyNeuLink/Scheduling/TimeScale.py rename to psyneulink/scheduling/timescale.py index 2085429e377..47d96352425 100644 --- a/PsyNeuLink/Scheduling/TimeScale.py +++ b/psyneulink/scheduling/timescale.py @@ -8,7 +8,7 @@ # from enum import Enum -from PsyNeuLink.Globals.Keywords import CENTRAL_CLOCK +from psyneulink.globals.keywords import CENTRAL_CLOCK # ********************************************* TimeScale *************************************************************** diff --git a/setup.py b/setup.py index b494e0dc696..e40df0d2253 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ long_description = f.read() setup( - name='PsyNeuLink', + name='psyneulink', # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see diff --git a/tests/composition/test_composition.py b/tests/composition/test_composition.py index e662efb53a2..1960219b366 100644 --- a/tests/composition/test_composition.py +++ b/tests/composition/test_composition.py @@ -1,19 +1,20 @@ import functools import logging + from timeit import timeit import numpy as np import pytest -from PsyNeuLink.Components.Functions.Function import Linear, SimpleIntegrator -from PsyNeuLink.Components.Mechanisms.Mechanism import mechanism -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms import IntegratorMechanism -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Composition import Composition, CompositionError, MechanismRole -from PsyNeuLink.Scheduling.Condition import EveryNCalls -from PsyNeuLink.Scheduling.Scheduler import Scheduler -from PsyNeuLink.Scheduling.TimeScale import TimeScale +from psyneulink.components.functions.function import Linear, SimpleIntegrator +from psyneulink.components.mechanisms.mechanism import mechanism +from psyneulink.components.mechanisms.processing import integratormechanism +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.composition import Composition, CompositionError, MechanismRole +from psyneulink.scheduling.condition import EveryNCalls +from psyneulink.scheduling.scheduler import Scheduler +from psyneulink.scheduling.timescale import TimeScale logger = logging.getLogger(__name__) @@ -44,7 +45,7 @@ def test_two_calls_no_args(self): ] ) def test_timing_no_args(self, count): - t = timeit('comp = Composition()', setup='from PsyNeuLink.Composition import Composition', number=count) + t = timeit('comp = Composition()', setup='from psyneulink.composition import Composition', number=count) print() logger.info('completed {0} creation{2} of Composition() in {1:.8f}s'.format(count, t, 's' if count != 1 else '')) @@ -78,8 +79,8 @@ def test_timing_stress(self, count): t = timeit( 'comp.add_mechanism(mechanism())', setup=''' -from PsyNeuLink.Components.Mechanisms.Mechanism import mechanism -from PsyNeuLink.Composition import Composition +from psyneulink.components.mechanisms.mechanism import mechanism +from psyneulink.composition import Composition comp = Composition() ''', number=count @@ -128,9 +129,9 @@ def test_add_same_twice(self): def test_timing_stress(self, count): t = timeit('comp.add_projection(A, MappingProjection(), B)', setup=''' -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Composition import Composition +from psyneulink.components.mechanisms.processingmechanisms.transfermechanism import TransferMechanism +from psyneulink.components.projections.pathwayprojections.mappingprojection import MappingProjection +from psyneulink.composition import Composition comp = Composition() A = TransferMechanism(name='A') B = TransferMechanism(name='B') @@ -705,7 +706,7 @@ class TestRun: def test_run_2_mechanisms_default_input_1(self): comp = Composition() - A = IntegratorMechanism(default_variable=1.0, function=Linear(slope=5.0)) + A = integratormechanism(default_variable=1.0, function=Linear(slope=5.0)) B = TransferMechanism(function=Linear(slope=5.0)) comp.add_mechanism(A) comp.add_mechanism(B) @@ -719,7 +720,7 @@ def test_run_2_mechanisms_default_input_1(self): def test_run_2_mechanisms_input_5(self): comp = Composition() - A = IntegratorMechanism(default_variable=1.0, function=Linear(slope=5.0)) + A = integratormechanism(default_variable=1.0, function=Linear(slope=5.0)) B = TransferMechanism(function=Linear(slope=5.0)) comp.add_mechanism(A) comp.add_mechanism(B) @@ -808,7 +809,7 @@ def test_run_5_mechanisms_2_origins_1_terminal(self): def test_run_2_mechanisms_with_scheduling_AAB_integrator(self): comp = Composition() - A = IntegratorMechanism(name="A [integrator]", default_variable=2.0, function=SimpleIntegrator(rate=1.0)) + A = integratormechanism(name="A [integrator]", default_variable=2.0, function=SimpleIntegrator(rate=1.0)) # (1) value = 0 + (5.0 * 1.0) + 0 --> return 5.0 # (2) value = 5.0 + (5.0 * 1.0) + 0 --> return 10.0 B = TransferMechanism(name="B [transfer]", function=Linear(slope=5.0)) @@ -886,7 +887,7 @@ def test_sender_receiver_not_specified(self): def test_run_2_mechanisms_reuse_input(self): comp = Composition() - A = IntegratorMechanism(default_variable=1.0, function=Linear(slope=5.0)) + A = integratormechanism(default_variable=1.0, function=Linear(slope=5.0)) B = TransferMechanism(function=Linear(slope=5.0)) comp.add_mechanism(A) comp.add_mechanism(B) @@ -903,7 +904,7 @@ def test_run_2_mechanisms_reuse_input(self): def test_run_2_mechanisms_incorrect_trial_spec(self): comp = Composition() - A = IntegratorMechanism(default_variable=1.0, function=Linear(slope=5.0)) + A = integratormechanism(default_variable=1.0, function=Linear(slope=5.0)) B = TransferMechanism(function=Linear(slope=5.0)) comp.add_mechanism(A) comp.add_mechanism(B) @@ -921,7 +922,7 @@ def test_run_2_mechanisms_incorrect_trial_spec(self): def test_run_2_mechanisms_double_trial_specs(self): comp = Composition() - A = IntegratorMechanism(default_variable=1.0, function=Linear(slope=5.0)) + A = integratormechanism(default_variable=1.0, function=Linear(slope=5.0)) B = TransferMechanism(function=Linear(slope=5.0)) comp.add_mechanism(A) comp.add_mechanism(B) @@ -938,7 +939,7 @@ def test_run_2_mechanisms_double_trial_specs(self): def test_execute_composition(self): comp = Composition() - A = IntegratorMechanism(default_variable=1.0, function=Linear(slope=5.0)) + A = integratormechanism(default_variable=1.0, function=Linear(slope=5.0)) B = TransferMechanism(function=Linear(slope=5.0)) comp.add_mechanism(A) comp.add_mechanism(B) @@ -1218,8 +1219,8 @@ def record_values(d, time_scale, *mechs): comp = Composition() - A = IntegratorMechanism(name="A [transfer]", function=SimpleIntegrator(rate=1)) - B = IntegratorMechanism(name="B [transfer]", function=SimpleIntegrator(rate=2)) + A = integratormechanism(name="A [transfer]", function=SimpleIntegrator(rate=1)) + B = integratormechanism(name="B [transfer]", function=SimpleIntegrator(rate=2)) comp.add_mechanism(A) comp.add_mechanism(B) comp.add_projection(A, MappingProjection(sender=A, receiver=B), B) diff --git a/tests/composition/test_graph.py b/tests/composition/test_graph.py index d5e67719e6a..b458d01cdd4 100644 --- a/tests/composition/test_graph.py +++ b/tests/composition/test_graph.py @@ -1,6 +1,6 @@ import pytest -from PsyNeuLink.Composition import Graph, Vertex +from psyneulink.composition import Graph, Vertex @pytest.mark.skip diff --git a/tests/control/test_EVC.py b/tests/control/test_EVC.py index 6138d9f4ccd..603511311a5 100644 --- a/tests/control/test_EVC.py +++ b/tests/control/test_EVC.py @@ -1,18 +1,18 @@ import numpy as np import pytest -from PsyNeuLink.Components.Functions.Function import Linear, BogaczEtAl, Exponential, DRIFT_RATE, THRESHOLD -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import ALLOCATION_SAMPLES, IDENTITY_MATRIX, MEAN, RESULT, VARIANCE -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import ComponentPreferenceSet, kpVerbosePref, \ +from psyneulink.components.functions.function import Linear, BogaczEtAl, Exponential, DRIFT_RATE, THRESHOLD +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection +from psyneulink.components.system import system +from psyneulink.globals.keywords import ALLOCATION_SAMPLES, IDENTITY_MATRIX, MEAN, RESULT, VARIANCE +from psyneulink.globals.preferences.componentpreferenceset import ComponentPreferenceSet, kpVerbosePref, \ kpReportOutputPref -from PsyNeuLink.Globals.Preferences.PreferenceSet import PreferenceEntry, PreferenceLevel -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.IntegratorMechanisms.DDM import DDM, DECISION_VARIABLE, \ +from psyneulink.globals.preferences.preferenceset import PreferenceEntry, PreferenceLevel +from psyneulink.library.mechanisms.processing.integrator.ddm import DDM, DECISION_VARIABLE, \ PROBABILITY_UPPER_THRESHOLD, RESPONSE_TIME -from PsyNeuLink.Library.Subsystems.EVC.EVCControlMechanism import EVCControlMechanism +from psyneulink.library.subsystems.evc.evccontrolmechanism import EVCControlMechanism def test_EVC(): diff --git a/tests/learning/test_multilayer.py b/tests/learning/test_multilayer.py index 3c67fdf4ca5..ed206f4749b 100644 --- a/tests/learning/test_multilayer.py +++ b/tests/learning/test_multilayer.py @@ -1,13 +1,13 @@ import numpy as np -from PsyNeuLink.Components.Functions.Function import Logistic -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import LEARNING, SOFT_CLAMP -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import REPORT_OUTPUT_PREF, VERBOSE_PREF -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.ObjectiveMechanisms.ComparatorMechanism import MSE +from psyneulink.components.functions.function import Logistic +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.system import system +from psyneulink.globals.keywords import LEARNING, SOFT_CLAMP +from psyneulink.globals.preferences.componentpreferenceset import REPORT_OUTPUT_PREF, VERBOSE_PREF +from psyneulink.library.mechanisms.processing.objective.comparatormechanism import MSE def test_multilayer(): diff --git a/tests/learning/test_reinforcement.py b/tests/learning/test_reinforcement.py index e025b705876..288c0bf7d6f 100644 --- a/tests/learning/test_reinforcement.py +++ b/tests/learning/test_reinforcement.py @@ -1,13 +1,13 @@ import numpy as np import pytest -from PsyNeuLink.Components.Functions.Function import PROB -from PsyNeuLink.Components.Functions.Function import Reinforcement, SoftMax -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.LearningProjection import LearningProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Scheduling.TimeScale import CentralClock +from psyneulink.components.functions.function import PROB +from psyneulink.components.functions.function import Reinforcement, SoftMax +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.learningprojection import LearningProjection +from psyneulink.components.system import system +from psyneulink.scheduling.timescale import CentralClock def test_reinforcement(): diff --git a/tests/learning/test_stroop.py b/tests/learning/test_stroop.py index b257bf2a4e0..9ef60b893b8 100644 --- a/tests/learning/test_stroop.py +++ b/tests/learning/test_stroop.py @@ -1,12 +1,12 @@ import numpy as np -from PsyNeuLink.Components.Functions.Function import Linear, Logistic -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.System import system, process -from PsyNeuLink.Globals.Keywords import FULL_CONNECTIVITY_MATRIX, LEARNING, LEARNING_PROJECTION -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import REPORT_OUTPUT_PREF, VERBOSE_PREF -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.ObjectiveMechanisms.ComparatorMechanism import MSE +from psyneulink.components.functions.function import Linear, Logistic +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.system import system, process +from psyneulink.globals.keywords import FULL_CONNECTIVITY_MATRIX, LEARNING, LEARNING_PROJECTION +from psyneulink.globals.preferences.componentpreferenceset import REPORT_OUTPUT_PREF, VERBOSE_PREF +from psyneulink.library.mechanisms.processing.objective.comparatormechanism import MSE class TestStroop: diff --git a/tests/mechanisms/test_ddm_mechanism.py b/tests/mechanisms/test_ddm_mechanism.py index 644966f7c1e..f6b7fad2e84 100644 --- a/tests/mechanisms/test_ddm_mechanism.py +++ b/tests/mechanisms/test_ddm_mechanism.py @@ -1,10 +1,10 @@ import pytest import typecheck import numpy as np -from PsyNeuLink.Components.Component import ComponentError -from PsyNeuLink.Components.Functions.Function import BogaczEtAl, DriftDiffusionIntegrator, FunctionError, NormalDist -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.IntegratorMechanisms.DDM import DDM, DDMError -from PsyNeuLink.Scheduling.TimeScale import TimeScale +from psyneulink.components.component import ComponentError +from psyneulink.components.functions.function import BogaczEtAl, DriftDiffusionIntegrator, FunctionError, NormalDist +from psyneulink.library.mechanisms.processing.integrator.ddm import DDM, DDMError +from psyneulink.scheduling.timescale import TimeScale # ======================================= FUNCTION TESTS ============================================ diff --git a/tests/mechanisms/test_gating_mechanism.py b/tests/mechanisms/test_gating_mechanism.py index 09cd364bc36..b54e243b175 100644 --- a/tests/mechanisms/test_gating_mechanism.py +++ b/tests/mechanisms/test_gating_mechanism.py @@ -1,14 +1,14 @@ import numpy as np -from PsyNeuLink.Components.Functions.Function import ConstantIntegrator, Logistic -from PsyNeuLink.Components.Mechanisms.AdaptiveMechanisms.GatingMechanism.GatingMechanism import GatingMechanism -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import FUNCTION, FUNCTION_PARAMS, INITIALIZER, LEARNING, RATE, SOFT_CLAMP, VALUE -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import REPORT_OUTPUT_PREF, VERBOSE_PREF -from PsyNeuLink.Scheduling.TimeScale import CentralClock +from psyneulink.components.functions.function import ConstantIntegrator, Logistic +from psyneulink.components.mechanisms.adaptive.gating.gatingmechanism import GatingMechanism +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.system import system +from psyneulink.globals.keywords import FUNCTION, FUNCTION_PARAMS, INITIALIZER, LEARNING, RATE, SOFT_CLAMP, VALUE +from psyneulink.globals.preferences.componentpreferenceset import REPORT_OUTPUT_PREF, VERBOSE_PREF +from psyneulink.scheduling.timescale import CentralClock def test_gating(): diff --git a/tests/mechanisms/test_integrator_mechanism.py b/tests/mechanisms/test_integrator_mechanism.py index cf220039acb..8635cbb899e 100644 --- a/tests/mechanisms/test_integrator_mechanism.py +++ b/tests/mechanisms/test_integrator_mechanism.py @@ -1,15 +1,15 @@ import numpy as np import pytest -from PsyNeuLink.Components.Functions.Function import AccumulatorIntegrator, ConstantIntegrator, NormalDist, \ +from psyneulink.components.functions.function import AccumulatorIntegrator, ConstantIntegrator, NormalDist, \ SimpleIntegrator, FHNIntegrator -from PsyNeuLink.Components.Functions.Function import AdaptiveIntegrator, DriftDiffusionIntegrator, \ +from psyneulink.components.functions.function import AdaptiveIntegrator, DriftDiffusionIntegrator, \ OrnsteinUhlenbeckIntegrator, AGTUtilityIntegrator -from PsyNeuLink.Components.Functions.Function import FunctionError -from PsyNeuLink.Components.Mechanisms.Mechanism import MechanismError -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.IntegratorMechanism \ +from psyneulink.components.functions.function import FunctionError +from psyneulink.components.mechanisms.mechanism import MechanismError +from psyneulink.components.mechanisms.processing.integratormechanism \ import IntegratorMechanism -from PsyNeuLink.Scheduling.TimeScale import TimeScale +from psyneulink.scheduling.timescale import TimeScale # ======================================= FUNCTION TESTS ============================================ diff --git a/tests/mechanisms/test_kwta.py b/tests/mechanisms/test_kwta.py index e62da13f5cb..a7d1252faa5 100644 --- a/tests/mechanisms/test_kwta.py +++ b/tests/mechanisms/test_kwta.py @@ -1,15 +1,15 @@ import pytest -from PsyNeuLink.Components.Component import ComponentError -from PsyNeuLink.Components.Functions.Function import Linear, Logistic -from PsyNeuLink.Components.Mechanisms.Mechanism import MechanismError -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import RANDOM_CONNECTIVITY_MATRIX -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import REPORT_OUTPUT_PREF, VERBOSE_PREF -from PsyNeuLink.Globals.Utilities import * -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.TransferMechanisms.KWTA import KWTA, KWTAError -from PsyNeuLink.Scheduling.TimeScale import TimeScale +from psyneulink.components.component import ComponentError +from psyneulink.components.functions.function import Linear, Logistic +from psyneulink.components.mechanisms.mechanism import MechanismError +from psyneulink.components.process import process +from psyneulink.components.system import system +from psyneulink.globals.keywords import MATRIX_KEYWORD_VALUES, RANDOM_CONNECTIVITY_MATRIX +from psyneulink.globals.preferences.componentpreferenceset import REPORT_OUTPUT_PREF, VERBOSE_PREF +from psyneulink.globals.utilities import UtilitiesError +from psyneulink.library.mechanisms.processing.transfer.kwta import KWTA, KWTAError +from psyneulink.scheduling.timescale import TimeScale class TestKWTAInputs: diff --git a/tests/mechanisms/test_recurrent_transfer_mechanism.py b/tests/mechanisms/test_recurrent_transfer_mechanism.py index 6cd0125d13c..a5fccda6afd 100644 --- a/tests/mechanisms/test_recurrent_transfer_mechanism.py +++ b/tests/mechanisms/test_recurrent_transfer_mechanism.py @@ -1,16 +1,16 @@ import numpy as np import pytest -from PsyNeuLink.Components.Functions.Function import ConstantIntegrator, Exponential, ExponentialDist, FunctionError, Linear, Logistic, NormalDist, Reduce, Reinforcement, get_matrix -from PsyNeuLink.Components.Mechanisms.Mechanism import MechanismError -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferError, TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import MATRIX_KEYWORD_VALUES, RANDOM_CONNECTIVITY_MATRIX -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import REPORT_OUTPUT_PREF, VERBOSE_PREF -from PsyNeuLink.Globals.Utilities import UtilitiesError -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.TransferMechanisms.RecurrentTransferMechanism import RecurrentTransferError, RecurrentTransferMechanism -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.TransferMechanisms.LCA import LCA +from psyneulink.components.functions.function import ConstantIntegrator, Exponential, ExponentialDist, FunctionError, Linear, Logistic, NormalDist, Reduce, Reinforcement, get_matrix +from psyneulink.components.mechanisms.mechanism import MechanismError +from psyneulink.components.mechanisms.processing.transfermechanism import TransferError, TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.system import system +from psyneulink.globals.keywords import MATRIX_KEYWORD_VALUES, RANDOM_CONNECTIVITY_MATRIX +from psyneulink.globals.preferences.componentpreferenceset import REPORT_OUTPUT_PREF, VERBOSE_PREF +from psyneulink.globals.utilities import UtilitiesError +from psyneulink.library.mechanisms.processing.transfer.recurrenttransfermechanism import RecurrentTransferError, RecurrentTransferMechanism +from psyneulink.library.mechanisms.processing.transfer.lca import LCA # class TestLCA: # def test_lca(self): diff --git a/tests/mechanisms/test_transfer_mechanism.py b/tests/mechanisms/test_transfer_mechanism.py index 479917871e7..a9a9bffc9b3 100644 --- a/tests/mechanisms/test_transfer_mechanism.py +++ b/tests/mechanisms/test_transfer_mechanism.py @@ -1,15 +1,15 @@ import numpy as np import pytest -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferError +from psyneulink.components.mechanisms.processing.transfermechanism import TransferError -from PsyNeuLink.Components.Component import ComponentError -from PsyNeuLink.Components.Functions.Function import ConstantIntegrator, Exponential, Linear, Logistic, Reduce, \ +from psyneulink.components.component import ComponentError +from psyneulink.components.functions.function import ConstantIntegrator, Exponential, Linear, Logistic, Reduce, \ Reinforcement, SoftMax -from PsyNeuLink.Components.Functions.Function import ExponentialDist, GammaDist, NormalDist, UniformDist, WaldDist -from PsyNeuLink.Components.Mechanisms.Mechanism import MechanismError -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Globals.Utilities import UtilitiesError -from PsyNeuLink.Scheduling.TimeScale import TimeScale +from psyneulink.components.functions.function import ExponentialDist, GammaDist, NormalDist, UniformDist, WaldDist +from psyneulink.components.mechanisms.mechanism import MechanismError +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.globals.utilities import UtilitiesError +from psyneulink.scheduling.timescale import TimeScale class TestTransferMechanismInputs: diff --git a/tests/no-learning/test_DDM.py b/tests/no-learning/test_DDM.py index f6918a6d60e..2f1385b847d 100644 --- a/tests/no-learning/test_DDM.py +++ b/tests/no-learning/test_DDM.py @@ -1,9 +1,9 @@ import numpy as np -from PsyNeuLink.Components.Functions.Function import BogaczEtAl -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Globals.Keywords import IDENTITY_MATRIX, FULL_CONNECTIVITY_MATRIX -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.IntegratorMechanisms.DDM import DDM +from psyneulink.components.functions.function import BogaczEtAl +from psyneulink.components.process import process +from psyneulink.globals.keywords import IDENTITY_MATRIX, FULL_CONNECTIVITY_MATRIX +from psyneulink.library.mechanisms.processing.integrator.ddm import DDM # does not run a system, can be used to ensure that running processes alone still works diff --git a/tests/no-learning/test_no-learning.py b/tests/no-learning/test_no-learning.py index 9858e9f8d74..271329f8c69 100644 --- a/tests/no-learning/test_no-learning.py +++ b/tests/no-learning/test_no-learning.py @@ -2,13 +2,13 @@ import numpy as np -from PsyNeuLink.Components.Functions.Function import Logistic -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import SOFT_CLAMP -from PsyNeuLink.Globals.Preferences.ComponentPreferenceSet import REPORT_OUTPUT_PREF, VERBOSE_PREF +from psyneulink.components.functions.function import Logistic +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.components.system import system +from psyneulink.globals.keywords import SOFT_CLAMP +from psyneulink.globals.preferences.componentpreferenceset import REPORT_OUTPUT_PREF, VERBOSE_PREF logger = logging.getLogger(__name__) diff --git a/tests/scheduling/test_condition.py b/tests/scheduling/test_condition.py index 4e754bc7353..36ce91b90c4 100644 --- a/tests/scheduling/test_condition.py +++ b/tests/scheduling/test_condition.py @@ -2,16 +2,16 @@ import pytest -from PsyNeuLink.Components.Functions.Function import Linear -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Composition import Composition -from PsyNeuLink.Scheduling.Condition import AfterCall, AfterNCalls, AfterNCallsCombined, AfterNPasses, AfterNTrials, \ +from psyneulink.components.functions.function import Linear +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.composition import Composition +from psyneulink.scheduling.condition import AfterCall, AfterNCalls, AfterNCallsCombined, AfterNPasses, AfterNTrials, \ AfterPass, AfterTrial, All, AllHaveRun, Always, Any, AtPass, AtTrial, BeforeNCalls, BeforePass, BeforeTrial, \ EveryNCalls, EveryNPasses, NWhen, Not, WhenFinished, WhenFinishedAll, WhenFinishedAny, WhileNot -from PsyNeuLink.Scheduling.Condition import ConditionError, ConditionSet -from PsyNeuLink.Scheduling.Scheduler import Scheduler -from PsyNeuLink.Scheduling.TimeScale import TimeScale +from psyneulink.scheduling.condition import ConditionError, ConditionSet +from psyneulink.scheduling.scheduler import Scheduler +from psyneulink.scheduling.timescale import TimeScale logger = logging.getLogger(__name__) diff --git a/tests/scheduling/test_scheduler.py b/tests/scheduling/test_scheduler.py index 124af5f5a1c..517861a0ac0 100644 --- a/tests/scheduling/test_scheduler.py +++ b/tests/scheduling/test_scheduler.py @@ -2,15 +2,15 @@ import pytest -from PsyNeuLink.Components.Functions.Function import Linear -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Projections.PathwayProjections.MappingProjection import MappingProjection -from PsyNeuLink.Composition import Composition -from PsyNeuLink.Scheduling.Condition import AfterNCalls, AfterNTrials, AfterPass, All, Always, Any, AtPass, \ +from psyneulink.components.functions.function import Linear +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.projections.pathway.mappingprojection import MappingProjection +from psyneulink.composition import Composition +from psyneulink.scheduling.condition import AfterNCalls, AfterNTrials, AfterPass, All, Always, Any, AtPass, \ BeforePass, \ EveryNCalls, EveryNPasses, JustRan, WhenFinished -from PsyNeuLink.Scheduling.Scheduler import Scheduler -from PsyNeuLink.Scheduling.TimeScale import TimeScale +from psyneulink.scheduling.scheduler import Scheduler +from psyneulink.scheduling.timescale import TimeScale logger = logging.getLogger(__name__) diff --git a/tests/scheduling/test_system_newsched.py b/tests/scheduling/test_system_newsched.py index 54a0f20792d..5c047ecc10c 100644 --- a/tests/scheduling/test_system_newsched.py +++ b/tests/scheduling/test_system_newsched.py @@ -1,17 +1,17 @@ import numpy -from PsyNeuLink.Components.Functions.Function import BogaczEtAl, Linear, Logistic, SimpleIntegrator -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.IntegratorMechanism \ +from psyneulink.components.functions.function import BogaczEtAl, Linear, Logistic, SimpleIntegrator +from psyneulink.components.mechanisms.processing.integratormechanism \ import IntegratorMechanism -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.IntegratorMechanisms.DDM import DDM -from PsyNeuLink.Library.Subsystems.EVC.EVCControlMechanism import EVCControlMechanism -from PsyNeuLink.Scheduling.Condition import AfterNCalls, All, Any, AtNCalls, AtPass, EveryNCalls, JustRan -from PsyNeuLink.Scheduling.Scheduler import Scheduler -from PsyNeuLink.Scheduling.TimeScale import TimeScale +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection +from psyneulink.components.system import system +from psyneulink.library.mechanisms.processing.integrator.ddm import DDM +from psyneulink.library.subsystems.evc.evccontrolmechanism import EVCControlMechanism +from psyneulink.scheduling.condition import AfterNCalls, All, Any, AtNCalls, AtPass, EveryNCalls, JustRan +from psyneulink.scheduling.scheduler import Scheduler +from psyneulink.scheduling.timescale import TimeScale class TestInit: diff --git a/tests/system/test_system.py b/tests/system/test_system.py index 565231ba7ef..0933e81c273 100644 --- a/tests/system/test_system.py +++ b/tests/system/test_system.py @@ -1,14 +1,14 @@ import numpy as np -from PsyNeuLink.Components.Functions.Function import BogaczEtAl, Linear, Logistic -from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism -from PsyNeuLink.Components.Process import process -from PsyNeuLink.Components.Projections.ModulatoryProjections.ControlProjection import ControlProjection -from PsyNeuLink.Components.System import system -from PsyNeuLink.Globals.Keywords import ALLOCATION_SAMPLES -from PsyNeuLink.Globals.Keywords import CYCLE, INITIALIZE_CYCLE, INTERNAL, ORIGIN, TERMINAL -from PsyNeuLink.Library.Mechanisms.ProcessingMechanisms.IntegratorMechanisms.DDM import DDM -from PsyNeuLink.Library.Subsystems.EVC.EVCControlMechanism import EVCControlMechanism +from psyneulink.components.functions.function import BogaczEtAl, Linear, Logistic +from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism +from psyneulink.components.process import process +from psyneulink.components.projections.modulatory.controlprojection import ControlProjection +from psyneulink.components.system import system +from psyneulink.globals.keywords import ALLOCATION_SAMPLES +from psyneulink.globals.keywords import CYCLE, INITIALIZE_CYCLE, INTERNAL, ORIGIN, TERMINAL +from psyneulink.library.mechanisms.processing.integrator.ddm import DDM +from psyneulink.library.subsystems.evc.evccontrolmechanism import EVCControlMechanism def test_danglingControlledMech(): diff --git a/tutorial/PsyNeuLink Tutorial.ipynb b/tutorial/PsyNeuLink Tutorial.ipynb index c2387db5098..b3a9e2030a8 100644 --- a/tutorial/PsyNeuLink Tutorial.ipynb +++ b/tutorial/PsyNeuLink Tutorial.ipynb @@ -75,13 +75,13 @@ "metadata": {}, "outputs": [], "source": [ - "from PsyNeuLink import IDENTITY_MATRIX\n", - "from PsyNeuLink.Components.System import system\n", + "from psyneulink import IDENTITY_MATRIX\n", + "from psyneulink.components.system import system\n", "\n", - "from PsyNeuLink.Components.Process import *\n", + "from psyneulink.components.process import *\n", "\n", - "from PsyNeuLink.Components.Mechanisms.ProcessingMechanisms.TransferMechanism import TransferMechanism\n", - "from PsyNeuLink.Components.Functions.Function import Linear, Logistic" + "from psyneulink.components.mechanisms.processing.transfermechanism import TransferMechanism\n", + "from psyneulink.components.functions.function import Linear, Logistic" ] }, {