Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.4.7.0 #776

Merged
merged 54 commits into from
May 1, 2018
Merged

v0.4.7.0 #776

merged 54 commits into from
May 1, 2018

Conversation

kmantel
Copy link
Collaborator

@kmantel kmantel commented May 1, 2018

jdcpni and others added 30 commits March 29, 2018 22:23
- added input_states and output_states to
    init and assign_args_to_params_dicts

• LinearMatrix
  - keyword:  fixed bug in which assignment of rows or cols
              could not handle scalars
* • IntegratorMechanism
  - added input_states and output_states to
    init and assign_args_to_params_dicts

• LinearMatrix
  - keyword:  fixed bug in which assignment of rows or cols
              could not handle scalars

* • Function
  Stability:
  - function: add PROB_INDICATOR option that assigns a value of 1
    to the probabilistically chosen option
  - _validate_params: moved call to super() to end to allow
      matrix param to be evaluated before continuing validation
* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* • Log
  LogCondition - subset of ContextFlags used to specified logPref

• Context
  ContextFlags - implemented as common set of context flags for:
  - initialization
  - execution tracking
  - logging
  ContextStatus - aliases to ContextFlags (for backward compatibility)

* • Log
  LogCondition - subset of ContextFlags used to specified logPref

• Context
  ContextFlags - implemented as common set of context flags for:
  - initialization
  - execution tracking
  - logging
  ContextStatus - aliases to ContextFlags (for backward compatibility)

* • Log
  LogCondition - subset of ContextFlags used to specified logPref

• Context
  ContextFlags - implemented as common set of context flags for:
  - initialization
  - execution tracking
  - logging
  ContextStatus - aliases to ContextFlags (for backward compatibility)

* -

* -

* -

* -

* -

* • Context
  context.status replaced with specific field assignments
  (.initialization_phase, .execution_phase, and .source)

* • Context
  context.status replaced with specific field assignments
  (.initialization_phase, .execution_phase, and .source)

* • Context
  context.status replaced with specific field assignments
  (.initialization_phase, .execution_phase, and .source)

* -

* -

* • Context
  context.status replaced with specific field assignments
  (.initialization_phase, .execution_phase, and .source)

* -

* -

* -

* -

* -

* • Context
  context.status replaced with specific field assignments
  (.initialization_phase, .execution_phase, and .source)
* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* -

* • Log
  LogCondition - subset of ContextFlags used to specified logPref

• Context
  ContextFlags - implemented as common set of context flags for:
  - initialization
  - execution tracking
  - logging
  ContextStatus - aliases to ContextFlags (for backward compatibility)

* • Log
  LogCondition - subset of ContextFlags used to specified logPref

• Context
  ContextFlags - implemented as common set of context flags for:
  - initialization
  - execution tracking
  - logging
  ContextStatus - aliases to ContextFlags (for backward compatibility)

* • Log
  LogCondition - subset of ContextFlags used to specified logPref

• Context
  ContextFlags - implemented as common set of context flags for:
  - initialization
  - execution tracking
  - logging
  ContextStatus - aliases to ContextFlags (for backward compatibility)

* -

* -

* -

* -

* -

* • Context
  context.status replaced with specific field assignments
  (.initialization_phase, .execution_phase, and .source)

* • Context
  context.status replaced with specific field assignments
  (.initialization_phase, .execution_phase, and .source)

* • Context
  context.status replaced with specific field assignments
  (.initialization_phase, .execution_phase, and .source)

* -

* -

* • Context
  context.status replaced with specific field assignments
  (.initialization_phase, .execution_phase, and .source)

* -

* -

* -

* -

* -

* -

* Merge branches 'devel' and 'refactor/context/structured' of https://github.com/PrincetonUniversity/PsyNeuLink into refactor/context/structured

# Conflicts:
#	.idea/runConfigurations/Tests.xml
#	Scripts/McClure.py

* Merge branches 'devel' and 'refactor/context/structured' of https://github.com/PrincetonUniversity/PsyNeuLink into refactor/context/structured

# Conflicts:
#	.idea/runConfigurations/Tests.xml
#	Scripts/McClure.py

* -

* -

* • Context
  - consolidated init_status into context.initialization_status

* • Context
  - consolidated init_status into context.initialization_status

* • Context
  - consolidated init_status into context.initialization_status
- initialization_status.UNSET -> initialization_status.INITALIZING
    where appropriate
  - delete InitStatus class
…nt overwriting results

Test names should indicate tested feature.
Fixes: daebb62 ("Linear combination fix
(#734)")
Cherry-picked from devel-llvm: fdc686e
* -

* -

* -

* -

* • Environment
  added _parse_input_labels() and _parse_target_labels() methods
  run(): modified to use _parse_input_labels and _parse_target_labels

* • Environment
  added _parse_input_labels() and _parse_target_labels() methods
  run(): modified to use _parse_input_labels and _parse_target_labels

* • Environment
  added _parse_input_labels() and _parse_target_labels() methods
  run(): modified to use _parse_input_labels and _parse_target_labels

* -

* -

* -

* -

* -

* • Mechanism
  added input_labels and output_labels propoerties
  added _get_state_value_labels() method

* • Merged with devel
* -

* -

* -

* -

* • Environment
  added _parse_input_labels() and _parse_target_labels() methods
  run(): modified to use _parse_input_labels and _parse_target_labels

* • Environment
  added _parse_input_labels() and _parse_target_labels() methods
  run(): modified to use _parse_input_labels and _parse_target_labels

* • Environment
  added _parse_input_labels() and _parse_target_labels() methods
  run(): modified to use _parse_input_labels and _parse_target_labels

* -

* -

* -

* -

* -

* -

* • Mechanism
  added input_labels and output_labels propoerties
  added _get_state_value_labels() method

* • Merged with devel

* • Environment
  _parse_input_labels(): added error messages

* • Environment
  _parse_input_labels(): added error messages

* • Environment
  Run: removed _parse_target_labels (they are just the input_labels
       for a TARGET Mechanism

• Mechanism
  docstring revs for INPUT_LABELS_DICDT and OUTPUT_LABELS_DICT
…n_ids

	- Conditions are no longer dependent on Schedulers, instead they can be
	checked for satisfaction with any Scheduler and any execution_id
	- must now provide a Scheduler and optionally execution_id (will use the
	Scheduler's default execution_id if not specified) to satisfaction call
	(typically determined contextually - user interface should not change under
	conceivably normal applications)
* feat/scheduling/decouple-conditions-scheduler:
  scheduling: decouple Scheduler and Condition, allow multiple execution_ids
  utilites: get method to prune unused args from a function from composition branch
* Fix/system/learning ends before terminal (#685)

* • System
  _instantiate_learning_graph(): fixed bug in which learning failed to
    be instantiated for a System in which the last Mechanism in a
    learning sequence was not the TERMINAL Mechanism of the System.

* • System
  _instantiate_learning_graph(): fixed bug in which learning failed to
    be instantiated for a System in which the last Mechanism in a
    learning sequence was not the TERMINAL Mechanism of the System.

* • Scripts/Examples
  Rumelhart Semantic Network: updated with step function

* Revert "Fix/system/learning ends before terminal (#685)"

This reverts commit a75aeb0.

* • Environment
  Run: removed _parse_target_labels (they are just the input_labels
       for a TARGET Mechanism

• Mechanism
  docstring revs for INPUT_LABELS_DICDT and OUTPUT_LABELS_DICT

* -

* -

* -

* -

* -

* • Component
  - _execute:  added **kwargs argument, passed to call to function
               to accomodate LearningMechanism that uses this

• AutoassociativeLearningMechanism
  - _execute calls super(LearningMechanism, self) to skip Learning

• LearningMechanism:
  _ execute calls super()._execute with **kwargs

* • Component
  - _execute:  added **kwargs argument, passed to call to function
               to accomodate LearningMechanism that uses this

• AutoassociativeLearningMechanism
  - _execute calls super(LearningMechanism, self) to skip Learning

• LearningMechanism:
  _ execute calls super()._execute with **kwargs

• PrecictionMechanism:
  _execute calls super()._execute

* • Component
  - _execute:  added **kwargs argument, passed to call to function
               to accomodate LearningMechanism and EVCControlMechanism,
               the functions for which expect additional arguments

• AutoassociativeLearningMechanism
  - _execute calls super(LearningMechanism, self) to skip Learning

• LearningMechanism:
  _ execute calls super()._execute with **kwargs

• PrecictionMechanism:
  _execute calls super()._execute

* • Component
  - _execute:  added **kwargs argument, passed to call to function
               to accomodate LearningMechanism and EVCControlMechanism,
               the functions for which expect additional arguments

• AutoassociativeLearningMechanism
  - _execute calls super(LearningMechanism, self) to skip Learning

• LearningMechanism:
  _ execute calls super()._execute with **kwargs

• PrecictionMechanism:
  _execute calls super()._execute
docstring:  added explanation of assignment of target labels to
              output_labels_dict for Mechanism that projects to
              TARGET Mechanism
* • Context
  docstring:  added for module and for Context class
  _get_context_string replaced with get_context_string (removed underscore)

* • Context
  docstring:  added for module and for Context class
  flags_string: added as an attribute
* • Environment
  Run: removed _parse_target_labels (they are just the input_labels
       for a TARGET Mechanism

• Mechanism
  docstring revs for INPUT_LABELS_DICDT and OUTPUT_LABELS_DICT

* -

* -

* -

* Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeuLink into JDC_WORKING

# Conflicts:
#	psyneulink/components/mechanisms/mechanism.py

* • System
  - replaced self.initialization_status with self.context.initialization_status

* • System
  - replaced self.initialization_status with self.context.initialization_status

• MappingProjection
  - _execute:  got rid of test for system

* • System
  - replaced self.initialization_status with self.context.initialization_status

• MappingProjection
  - _execute:  got rid of test for system

• Log
  LogCondition: removed _get_context_string

* • System
  - replaced self.initialization_status with self.context.initialization_status

• MappingProjection
  - _execute:  got rid of test for system

• Log
  LogCondition: _get_context_string -> _get_log_condition_string
…t does not correspond to the actual results of the mechanism
…spec-bug

fixing bug in looking up target values for learning which caused firs…
* • State, Keyword:
  kwStateName -> STATE_NAME

* • State, Keyword:
  kwStateName -> STATE_NAME
  kwStatePrefs -> STATE_PREFS

* • State, Keyword:
  kwStateName -> STATE_NAME
  kwStatePrefs -> STATE_PREFS
  kwStateContext -> STATE_CONTEXT

* -

* -

* -

* • Component
  check_args: added assignment of ContextFlag.VALIDATING during validation

* -

* -

* -

* -

* -

* -

* • Project:
  - implement all assignments to and tests against context regarding
    initialization and execution converted to context attribute

  - still need to implement message passing of context.source in place
    of context string for COMMAND_LINE and other circumstances
    (such as ADD_STATES, SET_ATTRIBUTES, RUN, etc.)
	- ROOD = ReadOnlyOrderedDict
	- if you passed in function_params as an entry in params, this dictionary
	would get assigned to object's function_params attribute, which could result
	in coupling and unintended changes
kmantel and others added 24 commits April 23, 2018 18:58
	- instead of copying some attributes (like an object's owner for instance),
	just copy the reference during a deepcopy
	- don't automatically make a copy of assigned Functions if not necessary
	(only copies an instance of a Function when it already has an owner)
	- when creating a default instance of a function, pass in its ClassDefaults
	as arguments
	- make Process and System have a property for self.function that refers to
	self.execute instead of setting this in the constructor
	- refactor constructor function arguments
		- ensure that Component has access to the actual Function instance (if
		specified) used to instantiate
		- assign defaults at the Component level
	- replace call using paramsCurrent to params (paramsCurrent[FUNCTION])
	doesn't exist anymore
	- ParamsDict no longer attempts to store and retrieve 'function' as an
	attribute on its owner
	- .function attribute is now a property when not specified as a method
	- add ComponentError for unsupported function type in
	Component._instantiate_function
	- ensure that Function classes get instance_defaults.value assigned by
	executing themselves in instantiate_value
	- update attributes dict to safely handle case in which it is called before
	function params are assigned
	- pass function argument to pre-function instantiation methods for the
	purpose of it being known when instantiating parameter states
	- update ParameterState creation to use passed in function to construct
	- OutputState: update documentation examples to proper function form
		- pass Function object not Function.function method to arguments
	- make function_params a property that refers to
	user_params['function_params'] instead of trying to sync them manually
	- add capability to increase a function's dimension to its owning
	Component's dimension if it's specified as such

	tests:
		- update some general formatting
		- update tests with now wrong/unnecessary extra variable specifications
		on Functions
		- update based on random number gen shift:

			differentials are based off of devel at cdce0f1, and represent how
			many fewer random seed calls occur before the first execute call in
			a test. Listed beside each test are the differentials, and the
			function of module numpy.random. So, at this commit, to
			get the numbers present on cdce0f1, if a test is listed below as
				test: -x, f
			then at the beginning of the test, run np.random.f() x times.

			- test_reinforcement: -1, random
			- test_DDM_noise_0_5: -1, normal
			- test_DDM_noise_2_0: -1, normal
			- test_integrator_simple_noise_fn: -1, normal
			- test_integrator_simple_noise_fn_var_list: -7, normal
			- test_integrator_accumulator_noise_fn: -1, normal
			- test_integrator_accumulator_noise_fn_var_list: -7, normal
			- test_integrator_constant_noise_fn_var_list: -6, normal
			- test_integrator_adaptive_noise_fn: -1, normal
			- test_integrator_adaptive_noise_fn_var_list: -7, normal
			- test_integrator_drift_diffusion_noise_val: -1, normal

	validation:
		- start coding for a centralized and modular validation scheme
		- refactor Component function validation to remove redundancy and be
		compatible with function argument passed up hierarchy
		- update DDM validation to allow function to be an instance of the
		required types, not just a class
		- refactor validation of function argument and values of Components
		- Integrator Functions: update rate validation
			- validate against Integrator instance_defaults.variable if present
			- otherwise set instance_defaults.variable
			- update some tests to reflect the new restriction where when
			specified, a mechanism's variable must exactly match its function's
			variable
			- update tests to reflect new handling of above errors and
			restriction
* • Project:
  - implement all assignments to and tests against context regarding
    initialization and execution converted to context attribute

  - still need to implement message passing of context.source in place
    of context string for COMMAND_LINE and other circumstances
    (such as ADD_STATES, SET_ATTRIBUTES, RUN, etc.)

* • Project:
  - implement message passing of context.source in place of context

* - context = ContextFlags.CONSTRUCTOR complete

* -

* -

* - partway through implementing all context arguments as ContextFlags

* - partway through implementing all context arguments as ContextFlags

* - partway through implementing all context arguments as ContextFlags

* - partway through implementing all context arguments as ContextFlags

* cleaning up use of helper methods in FHNIntegratorFunction and updating context check to ContextFlags

* - partway through implementing all context arguments as ContextFlags

* -

* -

* -

* -

* -

* -

* -

* - passes all tests

* Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeuLink into refactor/context/source_devel

# Conflicts:
#	psyneulink/components/component.py
#	psyneulink/components/functions/function.py
#	psyneulink/components/mechanisms/adaptive/control/controlmechanism.py
#	psyneulink/components/mechanisms/adaptive/control/defaultcontrolmechanism.py
#	psyneulink/components/mechanisms/adaptive/gating/gatingmechanism.py
#	psyneulink/components/mechanisms/adaptive/learning/learningauxiliary.py
#	psyneulink/components/mechanisms/adaptive/learning/learningmechanism.py
#	psyneulink/components/mechanisms/mechanism.py
#	psyneulink/components/mechanisms/processing/compositioninterfacemechanism.py
#	psyneulink/components/mechanisms/processing/defaultprocessingmechanism.py
#	psyneulink/components/mechanisms/processing/integratormechanism.py
#	psyneulink/components/mechanisms/processing/objectivemechanism.py
#	psyneulink/components/mechanisms/processing/processingmechanism.py
#	psyneulink/components/mechanisms/processing/transfermechanism.py
#	psyneulink/components/projections/modulatory/controlprojection.py
#	psyneulink/components/projections/modulatory/gatingprojection.py
#	psyneulink/components/projections/modulatory/learningprojection.py
#	psyneulink/components/projections/modulatory/modulatoryprojection.py
#	psyneulink/components/projections/pathway/mappingprojection.py
#	psyneulink/components/projections/pathway/pathwayprojection.py
#	psyneulink/components/projections/projection.py
#	psyneulink/components/shellclasses.py
#	psyneulink/components/states/parameterstate.py
#	psyneulink/components/states/state.py
#	psyneulink/globals/context.py
#	psyneulink/globals/environment.py
#	psyneulink/globals/log.py
#	psyneulink/library/mechanisms/adaptive/learning/autoassociativelearningmechanism.py
#	psyneulink/library/mechanisms/processing/integrator/ddm.py
#	psyneulink/library/mechanisms/processing/objective/comparatormechanism.py
#	psyneulink/library/mechanisms/processing/transfer/lca.py
#	psyneulink/library/mechanisms/processing/transfer/recurrenttransfermechanism.py
#	psyneulink/library/projections/pathway/autoassociativeprojection.py

* Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeuLink into refactor/context/source_devel

# Conflicts:
#	psyneulink/components/component.py
#	psyneulink/components/functions/function.py
#	psyneulink/components/mechanisms/adaptive/control/controlmechanism.py
#	psyneulink/components/mechanisms/adaptive/control/defaultcontrolmechanism.py
#	psyneulink/components/mechanisms/adaptive/gating/gatingmechanism.py
#	psyneulink/components/mechanisms/adaptive/learning/learningauxiliary.py
#	psyneulink/components/mechanisms/adaptive/learning/learningmechanism.py
#	psyneulink/components/mechanisms/mechanism.py
#	psyneulink/components/mechanisms/processing/compositioninterfacemechanism.py
#	psyneulink/components/mechanisms/processing/defaultprocessingmechanism.py
#	psyneulink/components/mechanisms/processing/integratormechanism.py
#	psyneulink/components/mechanisms/processing/objectivemechanism.py
#	psyneulink/components/mechanisms/processing/processingmechanism.py
#	psyneulink/components/mechanisms/processing/transfermechanism.py
#	psyneulink/components/projections/modulatory/controlprojection.py
#	psyneulink/components/projections/modulatory/gatingprojection.py
#	psyneulink/components/projections/modulatory/learningprojection.py
#	psyneulink/components/projections/modulatory/modulatoryprojection.py
#	psyneulink/components/projections/pathway/mappingprojection.py
#	psyneulink/components/projections/pathway/pathwayprojection.py
#	psyneulink/components/projections/projection.py
#	psyneulink/components/shellclasses.py
#	psyneulink/components/states/parameterstate.py
#	psyneulink/components/states/state.py
#	psyneulink/globals/context.py
#	psyneulink/globals/environment.py
#	psyneulink/globals/log.py
#	psyneulink/library/mechanisms/adaptive/learning/autoassociativelearningmechanism.py
#	psyneulink/library/mechanisms/processing/integrator/ddm.py
#	psyneulink/library/mechanisms/processing/objective/comparatormechanism.py
#	psyneulink/library/mechanisms/processing/transfer/lca.py
#	psyneulink/library/mechanisms/processing/transfer/recurrenttransfermechanism.py
#	psyneulink/library/projections/pathway/autoassociativeprojection.py

* -

* -

* -

* -

* -

* -

* -

* • LCA, DDM:
  - _execute:  self.function -> super._execute()

* • InputState, ParameterState:
  - _execute:  self.function -> super._execute()

* -

* -

* -

* • Context
  context argument of all methods replaced with ContextFlag
  self.context.string used for human-readable descriptive information
* • Project
  ADD_STATES removed

* • InputState
  __init__: added combine arg that allows operation argument of
            LinearCombination (the default functon) to be specified

* • InputState
  __init__: added combine arg that allows operation argument of
            LinearCombination (the default functon) to be specified

* -
* • Project
  ADD_STATES removed

* • InputState
  __init__: added combine arg that allows operation argument of
            LinearCombination (the default functon) to be specified

* • InputState
  __init__: added combine arg that allows operation argument of
            LinearCombination (the default functon) to be specified

* -

* -

* -

* • LinearCombination
  - function:  fixed problem with shape of weights and/or exponents

* • LinearCombination
  - function:  fixed problem with shape of weights and/or exponents

* -

* transfer mechanism's execute method now calls its function with the entire variable unless the function is a NormalizingFunction (useful for UDFs)

* -

* -

* -

* allowing transfer mechanism to have a UDF as its function and removing references to self.variable

* pytests for transfer mechanisms with user defined functions

* breaking TransferMechanism's _execute method up into helper methods in order to make LCA less repetitive

* removing print statement from transfer mech pytest

* • LCA
  - _execute: eliminated (by consolidating remaining bits into helper methods
- _execute: eliminated (by consolidating remaining bits into helper methods
- _execute: eliminated (by consolidating remaining bits into helper methods
* • LCA
  - _execute: eliminated (by consolidating remaining bits into helper methods

* • MaskMappingProjection
  - implemented as subclass of MappingProjection

* • MaskMappingProjection
  - implemented as subclass of MappingProjection
…nism_param - not intended for looking up 'variable'
…ble-exception

adding exceptions to get_current_function_param and get_current_mecha…
MaskedMappingProjection: added rst files
* devel:
  Feat/projections/masked mapping projection (#775)
  adding exceptions to get_current_function_param and get_current_mechanism_param - not intended for looking up 'variable'
  Feat/projections/masked mapping projection (#771)
  • LCA (#770)
  • LCA (#769)
  Refactor/mechanism/transfermechanism (#768)
  Fix default_variable bug (#767)
  Feat/inputstate/combine (#766)
  Refactor/context/source (#765)
  Defaults: ensure that function attr appears when examining Defaults
  Rewrite Function instantiation:
  Component: create fewer instances during init when function arg is a class
  LinearMatrix: make keyword method static to reflect how it is used
  refactor/rename _variable_not_specified to be more generic, using enum
  Defaults: add enum to denote flexibility of assignments
  Component: add class method to get new param class defaults
  Defaults: add ClassDefaults.function to several classes, and use it as fallback
  utilities: add function to detect if obj is an instance or a subclass of a class
  Component: override __deepcopy__ method to use shared items
  parsing: add method to parse function variable from variable
  imports: pycharm-optimize to avoid unnecessary circularities
  Params: copy dict/ROODs nested in params arguments to avoid side effects
  Refactor/context/set and test (#762)
  fixing bug in looking up target values for learning which caused first target value to be repeated
  LinearCombination, Reduce: handle negative exponents during init (avoid zero division)
  Functions: simplify noise validation
  adding a note to the ddm plot() documentation to clarify that the plot does not correspond to the actual results of the mechanism
  fixing drift diffusion integrator bug - returned threshold even when it crossed the negative threshold
  Fix/misc/misc (#759)
  PredictionErrorMechanism: correct infinite recursion in _execute
  Docs/context/context (#757)
  • Mechanism (#756)
  Refactor/mechanisms/ execute (#754)
  LearningAuxilliary: rename to LearningAuxiliary (correct double l typo)
  scheduling: decouple Scheduler and Condition, allow multiple execution_ids
  utilites: get method to prune unused args from a function from composition branch
  Feat/mechanism/input target lable dicts (#752)
  testing: Resolve leftover merge conflicts, fixes #747
  testing: correct pytest setup ovewrite, losing some settings
  Feat/mechanism/input target label dicts (#751)
  Scheduling: fix bug where termination conditions persisted across calls to run
  tests,function/LinearCombination: Add tests with absent parameters
  test,function/LinearCombination: Rename second test function to prevent overwriting results
  • Context (#746)
  Refactor/context/deprecate init status (#745)
  Refactor/context/structured (#744)
  Fix/function/stability (#743)
  • IntegratorMechanism (#742)
@kmantel kmantel merged commit 62eaf22 into master May 1, 2018
@kmantel kmantel deleted the maint/master-merge-devel branch May 1, 2018 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Solve merge conflict in test_composition.py
5 participants