Skip to content

Commit

Permalink
Merge pull request #1721 from PrincetonUniversity/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
dillontsmith committed Jul 20, 2020
2 parents 0374dca + 9124c03 commit 16e9407
Show file tree
Hide file tree
Showing 72 changed files with 32,470 additions and 1,510 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pnl-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: pytest --junit-xml=tests_out.xml --verbosity=0 -n auto
run: pytest --junit-xml=tests_out.xml --verbosity=0 -n auto --maxprocesses=2

- name: Upload test results
uses: actions/upload-artifact@v1
Expand Down
4 changes: 1 addition & 3 deletions Scripts/Debug/bryant_lca_with_termination.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import psyneulink as pnl
import numpy as np
import pytest

cueInterval = pnl.TransferMechanism(default_variable=[[0.0]],
size=1,
Expand Down Expand Up @@ -60,4 +58,4 @@
csiController.log.print_entries()
cueInterval.log.print_entries()
taskLayer.log.print_entries()
# csiController.control_signals[0].log.print_entries()
# csiController.control_signals[0].log.print_entries()
1 change: 0 additions & 1 deletion Scripts/Debug/predator_prey_opt/predator_prey_dmt.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
import os
import timeit
import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions Scripts/Examples/Rumelhart Semantic Network.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from psyneulink import *
import numpy as np
import typecheck as tc

# This script implements the following network, first described in Rumelhart and Todd
# (Rumelhart, D. E., & Todd, P. M. (1993). Learning and connectionist representations. Attention and performance XIV:
Expand Down
65 changes: 3 additions & 62 deletions docs/source/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -1,62 +1,3 @@
/*!**/
/*Sets bottom-margin size for list elements in the main body of the document to 12px.*/
/*Because Sphinx includes the table of contents in the main section, we then reset just the list elements*/
/*in that section to 0px.*/
/* *!*/

h1, h2{
margin-bottom:12px;
}

li{
margin-top:12px;
}

ul.simple{
margin-bottom:12px!important;
}

ol.simple{
margin-bottom:12px!important;
}

.section #overview {
margin-top: 24px;
}

#sections p,
#sections .simple,
#sections li{
margin-top:0px;
margin-bottom:0px!important;
}

.toctree-wrapper.compound li, div#sections li{
margin-top: 0px !important;
}

.toctree-wrapper.compound ul.simple{
display: none
}

#welcome-to-psyneulink-logo .simple li,
#welcome-to-logo .simple li,
#basics-and-sampler .simple li,
#basics-and-sampler .simple p,
#quick-reference #sections li,
#core li,
#contributors li,
#table-of-contents li,
#indices-and-tables li,
.wy-menu-vertical li,
.section #contents li,
.section #contents p,
.section #contents dd,
.section #contents dt,
.section #contents dl,
.section #contents ul,
.section #contents ol
{
margin-top:0px;
margin-bottom:0px!important;
}
/*
CSS styles defined in this file will be loaded into the docs at build time
*/
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_css_files = ['css/custom.css']

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down
36 changes: 3 additions & 33 deletions psyneulink/core/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
from .shellclasses import *
from .ports import *

from psyneulink.library.components.mechanisms.processing.integrator.ddm import DDM
from psyneulink.core.globals.preferences.basepreferenceset import BasePreferenceSet, ComponentDefaultPrefDicts, PreferenceLevel

__all__ = [
'InitError'
]
Expand All @@ -62,27 +65,17 @@ def __str__(self):

#region ***************************************** MECHANISM SUBCLASSES *************************************************

from psyneulink.core.components.mechanisms.mechanism import MechanismRegistry
from psyneulink.core.components.mechanisms.mechanism import Mechanism_Base
from psyneulink.core.components.mechanisms.processing.defaultprocessingmechanism \
import DefaultProcessingMechanism_Base
from psyneulink.core.components.mechanisms.modulatory.control.controlmechanism \
import ControlMechanism
register_category(entry=ControlMechanism,
base_class=Mechanism_Base,
registry=MechanismRegistry,
context=kwInitPy)

from psyneulink.core.components.mechanisms.modulatory.control.defaultcontrolmechanism \
import DefaultControlMechanism
register_category(entry=DefaultControlMechanism,
base_class=Mechanism_Base,
registry=MechanismRegistry,
context=kwInitPy)

# DDM (used as DefaultMechanism)

from psyneulink.library.components.mechanisms.processing.integrator.ddm import DDM
register_category(entry=DDM,
base_class=Mechanism_Base,
registry=MechanismRegistry,
Expand Down Expand Up @@ -113,46 +106,38 @@ def __str__(self):
# while still indexing multiple uses of the same base name within an owner
#
# Port registry
from psyneulink.core.components.ports.port import PortRegistry
from psyneulink.core.components.ports.port import Port_Base

# InputPort
from psyneulink.core.components.ports.inputport import InputPort
register_category(entry=InputPort,
base_class=Port_Base,
registry=PortRegistry,
context=kwInitPy)

# ParameterPort
from psyneulink.core.components.ports.parameterport import ParameterPort
register_category(entry=ParameterPort,
base_class=Port_Base,
registry=PortRegistry,
context=kwInitPy)

# OutputPort
from psyneulink.core.components.ports.outputport import OutputPort
register_category(entry=OutputPort,
base_class=Port_Base,
registry=PortRegistry,
context=kwInitPy)

# LearningSignal
from psyneulink.core.components.ports.modulatorysignals.learningsignal import LearningSignal
register_category(entry=LearningSignal,
base_class=Port_Base,
registry=PortRegistry,
context=kwInitPy)

# ControlSignal
from psyneulink.core.components.ports.modulatorysignals.controlsignal import ControlSignal
register_category(entry=ControlSignal,
base_class=Port_Base,
registry=PortRegistry,
context=kwInitPy)

# GatingSignal
from psyneulink.core.components.ports.modulatorysignals.gatingsignal import GatingSignal
register_category(entry=GatingSignal,
base_class=Port_Base,
registry=PortRegistry,
Expand All @@ -162,32 +147,26 @@ def __str__(self):
# Projection -----------------------------------------------------------------------------------------------------------

# Projection registry
from psyneulink.core.components.projections.projection import ProjectionRegistry
from psyneulink.core.components.projections.projection import Projection_Base

# MappingProjection
from psyneulink.core.components.projections.pathway.mappingprojection import MappingProjection
register_category(entry=MappingProjection,
base_class=Projection_Base,
registry=ProjectionRegistry,
context=kwInitPy)

# LearningProjection
from psyneulink.core.components.projections.modulatory.learningprojection import LearningProjection
register_category(entry=LearningProjection,
base_class=Projection_Base,
registry=ProjectionRegistry,
context=kwInitPy)

# ControlProjection
from psyneulink.core.components.projections.modulatory.controlprojection import ControlProjection
register_category(entry=ControlProjection,
base_class=Projection_Base,
registry=ProjectionRegistry,
context=kwInitPy)

# GatingProjection
from psyneulink.core.components.projections.modulatory.gatingprojection import GatingProjection
register_category(entry=GatingProjection,
base_class=Projection_Base,
registry=ProjectionRegistry,
Expand Down Expand Up @@ -271,23 +250,17 @@ def __str__(self):
#endregion

#region ***************************************** CLASS _PREFERENCES ***************************************************
from psyneulink.core.globals.preferences.basepreferenceset \
import BasePreferenceSet, ComponentDefaultPrefDicts, PreferenceLevel

from psyneulink.core.components.shellclasses import System_Base
System_Base.classPreferences = BasePreferenceSet(owner=System_Base,
prefs=ComponentDefaultPrefDicts[PreferenceLevel.INSTANCE],
level=PreferenceLevel.INSTANCE,
context=".__init__.py")

from psyneulink.core.components.shellclasses import Process_Base
Process_Base.classPreferences = BasePreferenceSet(owner=Process_Base,
prefs=ComponentDefaultPrefDicts[PreferenceLevel.INSTANCE],
level=PreferenceLevel.INSTANCE,
context=".__init__.py")


from psyneulink.core.components.shellclasses import Mechanism
Mechanism.classPreferences = BasePreferenceSet(owner=Mechanism,
prefs=ComponentDefaultPrefDicts[PreferenceLevel.CATEGORY],
level=PreferenceLevel.TYPE,
Expand All @@ -299,7 +272,6 @@ def __str__(self):
context=".__init__.py")


from psyneulink.core.components.shellclasses import Port
Port.classPreferences = BasePreferenceSet(owner=Port,
prefs=ComponentDefaultPrefDicts[PreferenceLevel.CATEGORY],
level=PreferenceLevel.CATEGORY,
Expand All @@ -315,13 +287,11 @@ def __str__(self):
level=PreferenceLevel.TYPE,
context=".__init__.py")

from psyneulink.core.components.shellclasses import Projection
Projection.classPreferences = BasePreferenceSet(owner=Projection,
prefs=ComponentDefaultPrefDicts[PreferenceLevel.CATEGORY],
level=PreferenceLevel.CATEGORY,
context=".__init__.py")

from psyneulink.core.components.functions.function import Function
Function.classPreferences = BasePreferenceSet(owner=Function,
prefs=ComponentDefaultPrefDicts[PreferenceLevel.CATEGORY],
level=PreferenceLevel.CATEGORY,
Expand Down
5 changes: 0 additions & 5 deletions psyneulink/core/components/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,18 +483,14 @@
import inspect
import logging
import numbers
import re
import types
import warnings
import weakref

from abc import ABCMeta
from collections.abc import Iterable
from collections import OrderedDict, UserDict
from enum import Enum, IntEnum

import numpy as np
import typecheck as tc

from psyneulink.core import llvm as pnlvm
from psyneulink.core.globals.context import \
Expand Down Expand Up @@ -2438,7 +2434,6 @@ def _validate_params(self, request_set, target_set=None, context=None):

elif target_set is not None:
# Copy any iterables so that deletions can be made to assignments belonging to the instance
from collections.abc import Iterable
if not isinstance(param_value, Iterable) or isinstance(param_value, str):
target_set[param_name] = param_value
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
Functions that return one or more samples from a distribution.
"""
from enum import IntEnum

import numpy as np
import typecheck as tc
Expand Down
4 changes: 0 additions & 4 deletions psyneulink/core/components/functions/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,6 @@ def _output_type_setter(value, owning_component):
# https://github.com/PrincetonUniversity/PsyNeuLink/issues/895 is solved
# properly(meaning Mechanism values may be something other than 2D np array)
try:
# import here because if this package is not installed, we can assume
# the user is probably not dealing with compilation so no need to warn
# unecessarily
import llvmlite
if (
isinstance(owning_component.owner, Mechanism)
and (
Expand Down
1 change: 0 additions & 1 deletion psyneulink/core/components/functions/objectivefunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"""

import functools
import itertools

import numpy as np
import typecheck as tc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2344,8 +2344,7 @@ def _import_elfi():
# https://github.com/scikit-optimize/scikit-optimize/issues/637
# Lets import and set the backend to PS to be safe. We aren't plotting anyway
# I guess. Only do this on Mac OS X
from sys import platform
if platform == "darwin":
if sys.platform == "darwin":
import matplotlib
matplotlib.use('PS')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
"""

import itertools
import numbers
import warnings

import numpy as np
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"""

from collections import deque, OrderedDict
from collections import deque

import numpy as np
import typecheck as tc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@
"""

import numpy as np
import abc
import typecheck as tc
import itertools
import warnings
import numbers

import abc
import numpy as np

from psyneulink.core import llvm as pnlvm
from psyneulink.core.components.component import DefaultsFlexibility
Expand Down
Loading

0 comments on commit 16e9407

Please sign in to comment.