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

Test/compositon/ validate input dict keys #2365

Merged
merged 424 commits into from
Mar 30, 2022

Conversation

jdcpni
Copy link
Collaborator

@jdcpni jdcpni commented Mar 29, 2022

• composition.py:

  • execute(): allow direct call to nested composition with inputs
    (see commented out sections marked MODIFIED 3/28/22 for alternative using context.source)

• test_composition.py:

  • test_inputs_key_errors()
    • test errors for keys in dict for inputs argument of run()
    • test for call to run() of nested composition

jdcpni and others added 30 commits December 2, 2021 23:24
…Link into devel

� Conflicts:
�	psyneulink/core/components/mechanisms/modulatory/control/optimizationcontrolmechanism.py
  - add allow_probes and exclude_probes_from_output
  - docstring mods re: allow_probes

• optimizationcontrolmechanism.py:
  - allow_probes:  eliminate DIRECT setting
  - remove _parse_monitor_for_control_input_ports (no longer needed without allow_probes=DIRECT)
  - change "exclude_probes_from_output" -> "include_probes_in_output"
  - docstring mods re: allow_probes and include_probes_in_output
  - docstring mods re: allow_probes and include_probes_in_output
  - add allow_probes handling (moved from OCM)

• optimizationcontrolmechanism.py:
  - move allow_probes to controlmechanism.py

• composition.py:
  - refactor handling of allow_probes to permit for any ControlMechanism

• objectivemechanism.py:
  - add modulatory_mechanism attribute
  - add allow_probes handling (moved from OCM)

• optimizationcontrolmechanism.py:
  - move allow_probes to controlmechanism.py

• composition.py:
  - refactor handling of allow_probes to permit for any ControlMechanism
  - add _handle_allow_probes_for_control() to reconcile setting on Composition and ControlMechanism

• objectivemechanism.py:
  - add modulatory_mechanism attribute
  add assignment of learning_mechanism to objective_mechanism.modulatory_mechanism for add_learning methods
  - add test_unnested_PROBE
  - add test_nested_PROBES
    TBD: test include_probes_in_output
  - add_node():  support tuple with required_role
  - _determine_node_roles:
     fix bug in which nested comp was prevented from being an OUTPUT Node if,
     in addition to Nodes that qualifed as OUTPUT, it also had nodes that projected
     to Nodes in an outer comp (making it look like it was INTERNAL)
…nUniversity/PsyNeuLink into feat/composition/probes

� Conflicts:
�	tests/composition/test_composition.py
  - add_node(): enforce include_probes_in_output = True for nested Compositions
  - execute():
    - replace return of output_value with get_output_value()
  - rename_instance_in_registry(): finish implementing (including **new_name** arg)

• optimizationcontrolmechanism.py:
  - _update_state_features_dict:  rename deferred state_input_ports
  - rename_instance_in_registry(): finish implementing (including **new_name** arg)

• optimizationcontrolmechanism.py:
  - _update_state_features_dict:  rename deferred state_input_ports
  - standarize prefixes for state_input_ports
  - standarize prefixes for state_input_ports
  - _show_structure(): fix parameterport label bug
…Link into refactor/ocm/state_features_all_as_input_ports
  _validate_input_keys(): add method to validate keys of inputs to run() method
…Link into refactor/ocm/state_features_all_as_input_ports

� Conflicts:
�	psyneulink/core/compositions/composition.py
  - test_inputs_key_errors()
  - test_inputs_key_errors():  add test for running nested composition with inputs
  - execute(): allow direct call to nested composition with inputs
@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.

1 similar comment
@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.

@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.

@jdcpni jdcpni merged commit 7afa437 into devel Mar 30, 2022
@jdcpni jdcpni deleted the test/compositon/_validate_input_dict_keys branch March 30, 2022 03:14
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

1 participant