+
Skip to content

Conversation

ansys-akarcher
Copy link
Contributor

@ansys-akarcher ansys-akarcher commented Sep 3, 2024

Expose the StreamsContainer.datasources getter property.

Allows notably to retrieve ip after starting grpc server

@ansys-akarcher ansys-akarcher marked this pull request as ready for review September 3, 2024 12:08
@PProfizi PProfizi added this to the v0.13.1 milestone Sep 4, 2024
@PProfizi PProfizi added the enhancement New feature or request label Sep 4, 2024
@PProfizi PProfizi changed the title expose streams_get_data_sources StreamsContainer.datasources Sep 4, 2024
@PProfizi
Copy link
Contributor

@ansys-akarcher for some reason it does not work on Docker.

@ansys-akarcher
Copy link
Contributor Author

Pasting here for future reference

=================================== FAILURES ===================================
_______________ test_streams_container_datasources[gRPC CLayer] ________________

server_type = <ansys.dpf.core.server_types.GrpcServer object at 0x7f03de7d24c0>
simple_bar = '/tmp/downloaded_examples/result_files/ASimpleBar.rst'

    def test_streams_container_datasources(server_type, simple_bar):
        ds = dpf.core.DataSources(simple_bar)
>       streams = dpf.core.operators.metadata.streams_provider(data_sources=ds).eval()

tests/test_streams_container.py:74: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/ansys/dpf/core/dpf_operator.py:765: in eval
    return self.outputs._outputs[0]()
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/ansys/dpf/core/outputs.py:97: in __call__
    return self.get_data()
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/ansys/dpf/core/outputs.py:94: in get_data
    return self._operator.get_output(self._pin, type_output)
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/ansys/dpf/core/dpf_operator.py:572: in get_output
    internal_obj = type_tuple[1](self, pin)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

op = <ansys.dpf.core.operators.metadata.streams_provider.streams_provider object at 0x7f03ddd90790>
iOutput = 0

    @staticmethod
    def operator_getoutput_streams(op, iOutput):
    	errorSize = ctypes.c_int(0)
    	sError = ctypes.c_wchar_p()
    	res = capi.dll.Operator_getoutput_streams(op._internal_obj if op is not None else None, utils.to_int32(iOutput), ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
    	if errorSize.value != 0:
>   		raise errors.DPFServerException(sError.value)
E     ansys.dpf.gate.errors.DPFServerException: Invalid API pointer when calling function Operator_getoutput_streams

/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/ansys/dpf/gate/generated/operator_capi.py:635: DPFServerException
______________ test_streams_container_datasources[ansys-grpc-dpf] ______________

server_type = <ansys.dpf.core.server_types.LegacyGrpcServer object at 0x7f03de794310>
simple_bar = '/tmp/downloaded_examples/result_files/ASimpleBar.rst'

    def test_streams_container_datasources(server_type, simple_bar):
        ds = dpf.core.DataSources(simple_bar)
>       streams = dpf.core.operators.metadata.streams_provider(data_sources=ds).eval()

tests/test_streams_container.py:74: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/ansys/dpf/core/dpf_operator.py:765: in eval
    return self.outputs._outputs[0]()
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/ansys/dpf/core/outputs.py:97: in __call__
    return self.get_data()
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/ansys/dpf/core/outputs.py:94: in get_data
    return self._operator.get_output(self._pin, type_output)
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/ansys/dpf/core/dpf_operator.py:572: in get_output
    internal_obj = type_tuple[1](self, pin)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

op = <ansys.dpf.core.operators.metadata.streams_provider.streams_provider object at 0x7f03de195b50>
iOutput = 0

    @staticmethod
    def operator_getoutput_streams(op, iOutput):
    	errorSize = ctypes.c_int(0)
    	sError = ctypes.c_wchar_p()
    	res = capi.dll.Operator_getoutput_streams(op._internal_obj if op is not None else None, utils.to_int32(iOutput), ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
    	if errorSize.value != 0:
>   		raise errors.DPFServerException(sError.value)
E     ansys.dpf.gate.errors.DPFServerException: Invalid API pointer when calling function Operator_getoutput_streams

/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/ansys/dpf/gate/generated/operator_capi.py:635: DPFServerException

Signed-off-by: paul.profizi <paul.profizi@ansys.com>
@PProfizi PProfizi merged commit ed0d520 into master Oct 3, 2024
43 checks passed
@PProfizi PProfizi deleted the fix/expose_streams_datasources branch October 3, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载