fed.get_subscription_by_name
doesn't work for subscriptions (unnamed inputs)
#61
Labels
bug
Something isn't working
Describe the bug
The federate class method "get_subscription_by_name" doesn't work for subscriptions since, by definition, they are unnamed inputs.
To Reproduce
Steps to reproduce the behavior:
Configure a federate using a JSON with the "subscription" object and try using the above method to get the subscription object. It will fail with a HELICS error saying there is no subscription by that name.
Environment (please complete the following information):
pip install helics
Share the output of the following:
Additional context and information
Here's the logging output we're seeing with the error message:
capi.py for pyhelics adds the subscription objects to the federates "subscriptions" attribute (a dictionary keyed to the subscription target) by referencing the subscription objects by index; both inputs and subscriptions are put into the same dictionary and then the "inputs" attribute is equated to the "subscription" attribute. The above method takes a string (the subscription name) as an input and calls "helicsFederateGetInput()". This will always fail for subscriptions since they are, by definition, unnamed.
The best improvement we could make here is:
The text was updated successfully, but these errors were encountered: