diff --git a/helics/capi.py b/helics/capi.py index dac669b6..69cd8389 100644 --- a/helics/capi.py +++ b/helics/capi.py @@ -695,6 +695,7 @@ class HelicsHandleOption(IntEnum): - **SINGLE_CONNECTION_ONLY** - **MULTIPLE_CONNECTIONS_ALLOWED** - **BUFFER_DATA** + - **RECONNECTABLE** - **STRICT_TYPE_CHECKING** - **RECEIVE_ONLY** - **SOURCE_ONLY** @@ -713,6 +714,7 @@ class HelicsHandleOption(IntEnum): SINGLE_CONNECTION_ONLY = 407 # HelicsHandleOptions MULTIPLE_CONNECTIONS_ALLOWED = 409 # HelicsHandleOptions BUFFER_DATA = 411 # HelicsHandleOptions + RECONNECTABLE = 412 # HelicsHandleOptions STRICT_TYPE_CHECKING = 414 # HelicsHandleOptions RECEIVE_ONLY = 422 # HelicsHandleOptions SOURCE_ONLY = 423 # HelicsHandleOptions @@ -724,13 +726,14 @@ class HelicsHandleOption(IntEnum): INPUT_PRIORITY_LOCATION = 510 # HelicsHandleOptions CLEAR_PRIORITY_LIST = 512 # HelicsHandleOptions CONNECTIONS = 522 # HelicsHandleOptions - + HELICS_HANDLE_OPTION_CONNECTION_REQUIRED = HelicsHandleOption.CONNECTION_REQUIRED HELICS_HANDLE_OPTION_CONNECTION_OPTIONAL = HelicsHandleOption.CONNECTION_OPTIONAL HELICS_HANDLE_OPTION_SINGLE_CONNECTION_ONLY = HelicsHandleOption.SINGLE_CONNECTION_ONLY HELICS_HANDLE_OPTION_MULTIPLE_CONNECTIONS_ALLOWED = HelicsHandleOption.MULTIPLE_CONNECTIONS_ALLOWED HELICS_HANDLE_OPTION_BUFFER_DATA = HelicsHandleOption.BUFFER_DATA +HELICS_HANDLE_OPTION_RECONNECTABLE = HelicsHandleOption.RECONNECTABLE HELICS_HANDLE_OPTION_STRICT_TYPE_CHECKING = HelicsHandleOption.STRICT_TYPE_CHECKING HELICS_HANDLE_OPTION_RECEIVE_ONLY = HelicsHandleOption.RECEIVE_ONLY HELICS_HANDLE_OPTION_SOURCE_ONLY = HelicsHandleOption.SOURCE_ONLY @@ -748,6 +751,7 @@ class HelicsHandleOption(IntEnum): helics_handle_option_single_connection_only = HelicsHandleOption.SINGLE_CONNECTION_ONLY helics_handle_option_multiple_connections_allowed = HelicsHandleOption.MULTIPLE_CONNECTIONS_ALLOWED helics_handle_option_buffer_data = HelicsHandleOption.BUFFER_DATA +helics_handle_option_reconnectable = HelicsHandleOption.RECONNECTABLE helics_handle_option_strict_type_checking = HelicsHandleOption.STRICT_TYPE_CHECKING helics_handle_option_receive_only = HelicsHandleOption.RECEIVE_ONLY helics_handle_option_source_only = HelicsHandleOption.SOURCE_ONLY diff --git a/tests/test_python_api.py b/tests/test_python_api.py index f9ee7528..7bced811 100644 --- a/tests/test_python_api.py +++ b/tests/test_python_api.py @@ -38,7 +38,7 @@ def test_python_api0(): in repr(sub) ) assert ( - """{ 'CONNECTION_REQUIRED' = 0, 'CONNECTION_OPTIONAL' = 0, 'SINGLE_CONNECTION_ONLY' = 0, 'MULTIPLE_CONNECTIONS_ALLOWED' = 1, 'BUFFER_DATA' = 0, 'STRICT_TYPE_CHECKING' = 0, 'RECEIVE_ONLY' = 0, 'SOURCE_ONLY' = 0, 'IGNORE_UNIT_MISMATCH' = 0, 'ONLY_TRANSMIT_ON_CHANGE' = 0, 'ONLY_UPDATE_ON_CHANGE' = 0, 'IGNORE_INTERRUPTS' = 0, 'MULTI_INPUT_HANDLING_METHOD' = 0, 'INPUT_PRIORITY_LOCATION' = -1, 'CLEAR_PRIORITY_LIST' = 1, 'CONNECTIONS' = 0 }""" + """{ 'CONNECTION_REQUIRED' = 0, 'CONNECTION_OPTIONAL' = 0, 'SINGLE_CONNECTION_ONLY' = 0, 'MULTIPLE_CONNECTIONS_ALLOWED' = 1, 'BUFFER_DATA' = 0, 'RECONNECTABLE' = 0, 'STRICT_TYPE_CHECKING' = 0, 'RECEIVE_ONLY' = 0, 'SOURCE_ONLY' = 0, 'IGNORE_UNIT_MISMATCH' = 0, 'ONLY_TRANSMIT_ON_CHANGE' = 0, 'ONLY_UPDATE_ON_CHANGE' = 0, 'IGNORE_INTERRUPTS' = 0, 'MULTI_INPUT_HANDLING_METHOD' = 0, 'INPUT_PRIORITY_LOCATION' = -1, 'CLEAR_PRIORITY_LIST' = 1, 'CONNECTIONS' = 0 }""" in repr(sub.option) ) sub.option["CONNECTION_REQUIRED"] = 1 @@ -86,7 +86,7 @@ def test_python_api1(): in repr(sub) ) assert ( - """{ 'CONNECTION_REQUIRED' = 0, 'CONNECTION_OPTIONAL' = 0, 'SINGLE_CONNECTION_ONLY' = 0, 'MULTIPLE_CONNECTIONS_ALLOWED' = 1, 'BUFFER_DATA' = 0, 'STRICT_TYPE_CHECKING' = 0, 'RECEIVE_ONLY' = 0, 'SOURCE_ONLY' = 0, 'IGNORE_UNIT_MISMATCH' = 0, 'ONLY_TRANSMIT_ON_CHANGE' = 0, 'ONLY_UPDATE_ON_CHANGE' = 0, 'IGNORE_INTERRUPTS' = 0, 'MULTI_INPUT_HANDLING_METHOD' = 0, 'INPUT_PRIORITY_LOCATION' = -1, 'CLEAR_PRIORITY_LIST' = 1, 'CONNECTIONS' = 0 }""" + """{ 'CONNECTION_REQUIRED' = 0, 'CONNECTION_OPTIONAL' = 0, 'SINGLE_CONNECTION_ONLY' = 0, 'MULTIPLE_CONNECTIONS_ALLOWED' = 1, 'BUFFER_DATA' = 0, 'RECONNECTABLE' = 0, 'STRICT_TYPE_CHECKING' = 0, 'RECEIVE_ONLY' = 0, 'SOURCE_ONLY' = 0, 'IGNORE_UNIT_MISMATCH' = 0, 'ONLY_TRANSMIT_ON_CHANGE' = 0, 'ONLY_UPDATE_ON_CHANGE' = 0, 'IGNORE_INTERRUPTS' = 0, 'MULTI_INPUT_HANDLING_METHOD' = 0, 'INPUT_PRIORITY_LOCATION' = -1, 'CLEAR_PRIORITY_LIST' = 1, 'CONNECTIONS' = 0 }""" in repr(sub.option) ) sub.option["CONNECTION_REQUIRED"] = 1 @@ -121,7 +121,7 @@ def test_python_api1(): assert sub.info == "hello world" assert ( - """{ 'CONNECTION_REQUIRED' = 0, 'CONNECTION_OPTIONAL' = 0, 'SINGLE_CONNECTION_ONLY' = 0, 'MULTIPLE_CONNECTIONS_ALLOWED' = 1, 'BUFFER_DATA' = 0, 'STRICT_TYPE_CHECKING' = 0, 'RECEIVE_ONLY' = 0, 'SOURCE_ONLY' = 0, 'IGNORE_UNIT_MISMATCH' = 0, 'ONLY_TRANSMIT_ON_CHANGE' = 0, 'ONLY_UPDATE_ON_CHANGE' = 0, 'IGNORE_INTERRUPTS' = 0, 'MULTI_INPUT_HANDLING_METHOD' = 0, 'INPUT_PRIORITY_LOCATION' = 0, 'CLEAR_PRIORITY_LIST' = 0, 'CONNECTIONS' = 0 }""" + """{ 'CONNECTION_REQUIRED' = 0, 'CONNECTION_OPTIONAL' = 0, 'SINGLE_CONNECTION_ONLY' = 0, 'MULTIPLE_CONNECTIONS_ALLOWED' = 1, 'BUFFER_DATA' = 0, 'RECONNECTABLE' = 0, 'STRICT_TYPE_CHECKING' = 0, 'RECEIVE_ONLY' = 0, 'SOURCE_ONLY' = 0, 'IGNORE_UNIT_MISMATCH' = 0, 'ONLY_TRANSMIT_ON_CHANGE' = 0, 'ONLY_UPDATE_ON_CHANGE' = 0, 'IGNORE_INTERRUPTS' = 0, 'MULTI_INPUT_HANDLING_METHOD' = 0, 'INPUT_PRIORITY_LOCATION' = 0, 'CLEAR_PRIORITY_LIST' = 0, 'CONNECTIONS' = 0 }""" in repr(mFed.publications["TestFederate/publication"].option) ) mFed.publications["TestFederate/publication"].option["CONNECTION_REQUIRED"] = 1 @@ -449,7 +449,7 @@ def test_python_api3(): source_filter1.add_source_target("ep1") assert ( - """<{ 'CONNECTION_REQUIRED' = 0, 'CONNECTION_OPTIONAL' = 0, 'SINGLE_CONNECTION_ONLY' = 0, 'MULTIPLE_CONNECTIONS_ALLOWED' = 0, 'BUFFER_DATA' = 0, 'STRICT_TYPE_CHECKING' = 0, 'RECEIVE_ONLY' = 0, 'SOURCE_ONLY' = 0, 'IGNORE_UNIT_MISMATCH' = 0, 'ONLY_TRANSMIT_ON_CHANGE' = 0, 'ONLY_UPDATE_ON_CHANGE' = 0, 'IGNORE_INTERRUPTS' = 0, 'MULTI_INPUT_HANDLING_METHOD' = 0, 'INPUT_PRIORITY_LOCATION' = 0, 'CLEAR_PRIORITY_LIST' = 0, 'CONNECTIONS' = 0 }>""" + """<{ 'CONNECTION_REQUIRED' = 0, 'CONNECTION_OPTIONAL' = 0, 'SINGLE_CONNECTION_ONLY' = 0, 'MULTIPLE_CONNECTIONS_ALLOWED' = 0, 'BUFFER_DATA' = 0, 'RECONNECTABLE' = 0, 'STRICT_TYPE_CHECKING' = 0, 'RECEIVE_ONLY' = 0, 'SOURCE_ONLY' = 0, 'IGNORE_UNIT_MISMATCH' = 0, 'ONLY_TRANSMIT_ON_CHANGE' = 0, 'ONLY_UPDATE_ON_CHANGE' = 0, 'IGNORE_INTERRUPTS' = 0, 'MULTI_INPUT_HANDLING_METHOD' = 0, 'INPUT_PRIORITY_LOCATION' = 0, 'CLEAR_PRIORITY_LIST' = 0, 'CONNECTIONS' = 0 }>""" in repr(source_filter1.option) )