Skip to content

Commit

Permalink
Fix/state/duplicate projection fa (#882)
Browse files Browse the repository at this point in the history
* -

* • State
  - _instantiate_projections_to_state:
     fixed bug in which deferred_init projection was triggering duplicate warning
  • Loading branch information
jdcpni authored Jul 20, 2018
1 parent 0a954e8 commit 99d78b3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .idea/runConfigurations/Scratch_Pad.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .idea/runConfigurations/py_test_in_tests.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,6 @@ def _instantiate_input_states(self, monitored_output_states_specs=None, referenc
# Use self.input_states (containing specs from **input_states** arg of constructor) or
# or pass off instantiation of default InputState(s) to super
input_states = self.input_states or None
# return super()._instantiate_input_states(input_states=input_states, context=context)
input_states = super()._instantiate_input_states(input_states=input_states, context=context)

else:
Expand Down
3 changes: 2 additions & 1 deletion psyneulink/components/states/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,8 @@ def _instantiate_projections_to_state(self, projections, context=None):

# Avoid duplicates, since instantiation of projection may have already called this method
# and assigned Projection to self.path_afferents or mod_afferents lists
if any(proj.sender == projection.sender for proj in self.path_afferents):
# if any(proj.sender == projection.sender and proj != projection for proj in self.path_afferents):
if any(proj.sender == projection.sender and proj != projection for proj in self.path_afferents):
warnings.warn('{} from {} of {} to {} of {} already exists; will ignore additional one specified ({})'.
format(Projection.__name__, repr(projection.sender.name),
projection.sender.owner.name,
Expand Down

0 comments on commit 99d78b3

Please sign in to comment.