Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Refactor/ports/restrict projections #2327

Merged
merged 264 commits into from
Feb 18, 2022
Merged

Conversation

jdcpni
Copy link
Collaborator

@jdcpni jdcpni commented Feb 18, 2022

• Refactor port.py to prohibit:
- efferents attribute on InputPorts and ParameterPorts
- path_afferents attribute on OutputPports

• Tests added to test_input_ports, test_parameter_ports, test_output_ports

• Add keywords PATH_AFFERENTS, MOD_AFFERENTS, EFFERENTS

jdcpni and others added 30 commits November 7, 2021 19:27
  - _instantiate_control_signals: random_seeds -> random_seed_mod_values
  - _add_controller:  modifying to instantiate feature_input_ports if none are specified
  - add_controller:  now adds feature_input_ports for Compostion INPUT nodes if not state_features not specified
  - _add_controller:  modifying to instantiate feature_input_ports if none are specified
  - add_controller:  assign simulation_input_ports
  - feature_input_ports -> state_input_ports
  - _instantiate_input_ports():
      state_features only allowed to specifying state_input_ports if
      agent_rep is a CompositionFunctionApproximator (i.e., model-free optimization)

• composition.py:
  - add_controller: adds state_input_ports to shadow INPUT Nodes of Composition
    if controller.agent_rep is Composition (model-based optimziation)
    or state_features have not been specified (for model-free optimizaton)
  _instantiate_input_ports:
     reinstate allowance of state_features specification if agent_rep is a Composition
     (i.e., model-based optimization) as long as they are all INPUT Nodes of agent_rep
  - _gen_llvm_evaluate_function: num_estimates -> num_estimates_per_trial
  - _gen_llvm_evaluate_function: num_estimates -> num_trial_per_estimate
…rincetonUniversity/PsyNeuLink into refactor/ocm/state_input_ports

� Conflicts:
�	psyneulink/core/components/mechanisms/modulatory/control/optimizationcontrolmechanism.py
  - _gen_llvm_evaluate_function: num_estimates -> num_trials_per_estimate
…ut_ports

# Conflicts:
#	psyneulink/core/components/mechanisms/modulatory/control/optimizationcontrolmechanism.py
  - __init__: moved controller instantiation until after nodes, projections and pathways
  - refactor to eliminate:
    - efferents attribute from InputPorts and Parameters
    - path_afferents attribute from OutputPports
  - add remove_projections()
  - add mod_afferents property
  - _get_input_struct_type(): add try and accept for path_afferents
• inputport.py:
  - add path_afferents override
• parameterport.py:
  - add path_afferents override
• outputport.py:
  - add efferents override
• composition.py:
  - add_projection(): call port.remove_projection
• keywords.py:
  add PATH_AFFERENTS, MOD_AFFERENTS, EFFERENTS
  - add test_no_efferents()
  - add test_no_path_afferents()
  - add test_no_path_afferents()
  - add test_no_efferents()
@github-actions
Copy link

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

No differences!

...

See CI logs for the full diff.

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Feb 18, 2022

This pull request introduces 5 alerts when merging 82ef44c into d7f68ad - view on LGTM.com

new alerts:

  • 2 for Except block handles 'BaseException'
  • 2 for Unused import
  • 1 for `__init__` method calls overridden method

@jdcpni jdcpni merged commit 4b5818f into devel Feb 18, 2022
@jdcpni jdcpni deleted the refactor/ports/restrict_projections branch February 18, 2022 15:45
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.

None yet

3 participants