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

Mechanism nodes created by the EMComposition json_summary issue #3174

Open
ddelpiano opened this issue Jan 28, 2025 · 2 comments
Open

Mechanism nodes created by the EMComposition json_summary issue #3174

ddelpiano opened this issue Jan 28, 2025 · 2 comments

Comments

@ddelpiano
Copy link

As per title, we noticed that some of the nodes created as boilerplate by the EMCompositon have some problems in the json summary, in details it seems that the input ports are not documented correctly in the json summary and instead these are projections linked to the node itself.

An example:

checking the node (ProcessingMechanism PREVIOUS_STATE [QUERY]) we can see that the json summary, at the input ports key has the following:

'PREVIOUS_STATE__QUERY__input_port__INPUT_CIM_PREVIOUS_STATE__QUERY__InputPort_0__to__PREVIOUS_STATE__QUERY__InputPort_0_'

and

'PREVIOUS_STATE__QUERY__input_port_MappingProjection_from_PREVIOUS_STATE_OutputPort_0__to_PREVIOUS_STATE__QUERY__InputPort_0_'

which, looking into the data does not seems to be input ports, also confirmed by checking node.input_ports which return the following:

[(InputPort InputPort-0)]

Follow the model used:
https://github.com/MetaCell/PsyNeuLinkView/tree/main/test_models/CSW

Thanks

@kmantel
Copy link
Collaborator

kmantel commented Jan 29, 2025

I wasn't able to run the full script there with current PNL versions, but it got far enough to see this.

The PNL and MDF/json "input port"s are slightly different. PNL InputPorts can accept multiple Projections, but MDF input ports can only accept one. So if there are multiple Projections to a PNL InputPort, we create one MDF input port for each, and then add a combination function to the MDF node. PNL InputPort handles this combination itself. So those two you're seeing correspond to InputPort-0 in this example.

I see how this is confusing because it wasn't obvious to me what was happening just by reading the port names

Will provide more info

@kmantel
Copy link
Collaborator

kmantel commented Jan 30, 2025

The only other thing I can say is that when one PNL InputPort corresponds to more than one MDF input port, the MDF input ports will be named by combining the Mechanism and Projection's names, and they should be in the same order as PNL InputPorts

But let me know if you need more info

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

No branches or pull requests

2 participants