-
Notifications
You must be signed in to change notification settings - Fork 29
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/ocm/state features all as input ports #2345
Merged
jdcpni
merged 320 commits into
devel
from
refactor/ocm/state_features_all_as_input_ports
Mar 17, 2022
Merged
Refactor/ocm/state features all as input ports #2345
jdcpni
merged 320 commits into
devel
from
refactor/ocm/state_features_all_as_input_ports
Mar 17, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- _instantiate_monitor_for_control_input_ports -> _parse_monitor_control_input_ports - refactored to support allow_probes option on ocm
__init__: move controller to after add_nodes and add_linear_pathway
_instantiate_control_projections: weird requirement for double-call to controller._instantiate_control_signal
restored parameter spec that causes crash ('threshold',Decision2)
…trol specs - composition.py - _get_control_signals_for_composition: (see 11/20/21) - added (but commented out change) to "if node.controller" to "if not node.controller" - changed append to extend - _instantiation_control_projection: - got rid of try and except double-call to controller._instantiate_control_signals - outdented call to self.controller._activate_projections_for_composition at end - controlmechanism.py: - _check_for_duplicates: add warning and return duplicates - optimizationcontrolmechanism._instantiate_control_signals: - add call to self.agent_rep._get_control_signals_for_composition() to get local control specs (on mechs in comp) - eliminate duplicates with control_signal specs on OCM - instantiate local + ocm control_signals - parameterestimationcomposition.py - added context to various calls
- test_parameterestimationcomposition - test_composition/test_partially_overlapping_control_specs (ADDED IN THIS COMMINT) - All relevant changes to this branch are marked as "11/21/21." However, most are commented out as they break other things. - The tests above both involve local control specifications (on mechanism within a nested comp) and on the OCM for the outer composition, some of which are for the same nested mechs - Both tests fail with: "AttributeError: 'NoneType' object has no attribute '_get_by_time_scale'" (in component.py LINE 3276) This may be due to a problem with context setting, since the error is because the modulation Parameter of the ControlProjection is returning "None" rather than "multiplicative_param" (when called with get(context)), whereas "multiplicative_param" is returned with a call to get() (i.e., with no context specified) - Most of test_partially_overlapping_control_specs is passed if changes marked "11/21/21 NEW" in optimizationcontrolmechanism.py (LINE 1390) are implemented, but it does not properly route ControlProjections through parameter_CIMS (see last assert in test). Furthermore, test_parameterestimationcompsition fails with the mod param error, even though the model has similar structure (i.e., outer composition -- in this case a ParameterEstimationComposition) with an OCM that is given control specs that overlap with ones in a nested composition. - There are also several other things in composition I found puzzling and tried modifying, but that cuased failures: - _get_control_signals_for_composition(): - seems "if node.controller" should be "if **not** node.controller" (emphasis added just for comment) - "append" should be "extend" - _instantiate_control_projection(): - call to self.controller._activate_projections_for_composition (at end of method) should not be indented
- rename _check_projection_initialization_status -> _check_controller_initialization_status - add _check_nodes_initialization_status(context=context) (and calls it with _check_controller_initialization_status)
This pull request introduces 2 alerts and fixes 2 when merging a382d47 into 2cd6de2 - view on LGTM.com new alerts:
fixed alerts:
|
- _parse_names_in_inputs(): support Port.full_name as keys in inputs dict • mechanism.py: - Mechanism_Base: replaced input_labels and output_labels with labeled_input_values and labeled_output_values respectively • port.py, inputport.py, outputport.py, parameterport.py: - Port_Base: impelment labeled_value property (and value_label alias) that returns calls get_label() - deleted label attributes of InputPort and OutputPort (replaced by Port_Base.labeled_value) - added get_label() stub on ParameterPort with error message
comment out 'sphinx_autodoc_typehints' (crashing for sphinx_autodoc_typehints v.1.17.0)
restore 'sphinx_autodoc_typehints' • doc_requirements.txt: pin sphinx_autodoc_typehints < v.1.16.0; error on v1.16 and v1.17; error: https://github.com/PrincetonUniversity/PsyNeuLink/runs/5573651890?check_suite_focus=true
This pull request introduces 1 alert and fixes 5 when merging 16f66cb into 0210bfe - view on LGTM.com new alerts:
fixed alerts:
|
This PR causes the following changes to the html docs (ubuntu-latest-3.7-x64):
See CI logs for the full diff. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
• doc_requirements.txt:
pin sphinx_autodoc_typehints < v.1.16.0; error on v1.16 and v1.17; error:
https://github.com/PrincetonUniversity/PsyNeuLink/runs/5573651890?check_suite_focus=true
• composition.py:
• mechanism.py:
• port.py, inputport.py, outputport.py, parameterport.py:
• optimizationcontrolmechanism:
- support specification of INPUT Nodes and/or their InputPorts
in nested Composition of agent_rep in set and dict formats
- refactor state_feature_values as dict used as predicted_inputs / feature_values arg of evaluate()
- _get_agent_rep_input_nodes()
- rename as _get_agent_rep_input_receivers(), call composition._get_input_receivers()
- default behavior is now to return list of INPUT Node InputPorts rather than INPUT Nodes themselves