diff --git a/psyneulink/core/compositions/composition.py b/psyneulink/core/compositions/composition.py index 27fe68383f8..3905bd62f19 100644 --- a/psyneulink/core/compositions/composition.py +++ b/psyneulink/core/compositions/composition.py @@ -1088,7 +1088,7 @@ the `default_variable ` for each `INPUT` Node is used as its input on `TRIAL `. If it is not specified for the `learn ` method, an error is generated unless its **targets** argument is specified (see `below `). The Composition's `get_input_format() -` method can be used to show a template for how inputs should be formatted for the +` method can be used to show an example for how inputs should be formatted for the Composition, as well as the `INPUT ` Nodes to which they are assigned. The formats are described in more detail below. @@ -10563,8 +10563,8 @@ def get_input_format(self, ------- Either a dict formatted appropriately for assignment as the **inputs** argument of the Composition's `run() - method (default), or string showing the format required by the **inputs** argument ` - (template_dict=False) + method (form = *DICT*, the default), or string showing the format required by the **inputs** argument + ` (form = *TEXT*). """ @@ -10582,7 +10582,9 @@ def _get_labels(labels_dict, index, input_port): except KeyError: # Dict with no InputPort-specific subdicts, used to specify labels for all InputPorts of Mechanism return list(labels_dict.keys()) - raise CompositionError(f"Unable to find labels for '{input_port.full_name}' of '{input_port.owner.name}'.") + except: + assert False, f"PROGRAM ERROR: Unable to find labels for " \ + f"'{input_port.full_name}' of '{input_port.owner.name}'." def _get_inputs(comp, nesting_level=1, use_labels=False, template_dict=str): diff --git a/tests/composition/test_control.py b/tests/composition/test_control.py index d23e6021654..99287018c91 100644 --- a/tests/composition/test_control.py +++ b/tests/composition/test_control.py @@ -845,29 +845,29 @@ def test_args_specific_to_ocm(self, id, agent_rep, state_features, monitor_for_c ] state_feature_args = [ - # ('partial_legal_list_spec', messages[0], None, UserWarning), - # ('full_list_spec', None, None, None), - # ('list_spec_with_none', None, None, None), - # ('input_dict_spec', None, None, None), - # ('input_dict_spec_short', None, None, None), - # ('set_spec', None, None, None), - # ('set_spec_short', None, None, None), - # ('automatic_assignment', None, None, None), - # ('shadow_inputs_dict_spec', None, None, None), - # ('shadow_inputs_dict_spec_w_none', None, None, None), - # ('misplaced_shadow', messages[1], None, pnl.CompositionError), - # ('ext_shadow', messages[2], None, pnl.OptimizationControlMechanismError), - # ('ext_output_port', messages[3], None, pnl.OptimizationControlMechanismError), + ('partial_legal_list_spec', messages[0], None, UserWarning), + ('full_list_spec', None, None, None), + ('list_spec_with_none', None, None, None), + ('input_dict_spec', None, None, None), + ('input_dict_spec_short', None, None, None), + ('set_spec', None, None, None), + ('set_spec_short', None, None, None), + ('automatic_assignment', None, None, None), + ('shadow_inputs_dict_spec', None, None, None), + ('shadow_inputs_dict_spec_w_none', None, None, None), + ('misplaced_shadow', messages[1], None, pnl.CompositionError), + ('ext_shadow', messages[2], None, pnl.OptimizationControlMechanismError), + ('ext_output_port', messages[3], None, pnl.OptimizationControlMechanismError), ('input_format_wrong_shape', messages[4], None, pnl.OptimizationControlMechanismError), - # ('too_many_inputs_warning', messages[5], None, UserWarning), - # ('too_many_w_node_not_in_composition_warning', messages[6], None, UserWarning), - # ('too_many_inputs_error', messages[7], None, pnl.OptimizationControlMechanismError), - # ('bad_dict_spec_warning', messages[8], None, UserWarning), - # ('bad_dict_spec_error', messages[8], None, pnl.OptimizationControlMechanismError), - # ('bad_set_spec_warning', messages[0], messages[9], UserWarning), - # ('bad_set_spec_error', messages[9], None, pnl.OptimizationControlMechanismError), - # ('comp_in_list_spec', messages[10], None, pnl.OptimizationControlMechanismError), - # ('comp_in_shadow_inupts_spec', messages[11], None, pnl.OptimizationControlMechanismError) + ('too_many_inputs_warning', messages[5], None, UserWarning), + ('too_many_w_node_not_in_composition_warning', messages[6], None, UserWarning), + ('too_many_inputs_error', messages[7], None, pnl.OptimizationControlMechanismError), + ('bad_dict_spec_warning', messages[8], None, UserWarning), + ('bad_dict_spec_error', messages[8], None, pnl.OptimizationControlMechanismError), + ('bad_set_spec_warning', messages[0], messages[9], UserWarning), + ('bad_set_spec_error', messages[9], None, pnl.OptimizationControlMechanismError), + ('comp_in_list_spec', messages[10], None, pnl.OptimizationControlMechanismError), + ('comp_in_shadow_inupts_spec', messages[11], None, pnl.OptimizationControlMechanismError) ] @pytest.mark.control