Skip to content

Conversation

@pyansys-ci-bot
Copy link
Collaborator

An update of generated code has been triggered either manually or by an update in the dpf-standalone repository.

@pyansys-ci-bot pyansys-ci-bot added the server-sync DO NOT USE, Related to automatic synchronization with the server label Mar 18, 2025
@PProfizi PProfizi merged commit 3178e21 into feat/add_operator_alias Mar 18, 2025
39 of 43 checks passed
@PProfizi PProfizi deleted the maint/update_code_for_252_on_feat/add_operator_alias branch March 18, 2025 15:31
@codecov
Copy link

codecov bot commented Mar 18, 2025

❌ 5 Tests Failed:

Tests completed Failed Passed Skipped
25569 5 25564 3385
View the top 3 failed test(s) by shortest run time
tests/test_data_tree.py::test_read_from_txt_data_tree[ansys-grpc-dpf]
Stack Traces | 0.02s run time
server_type = <ansys.dpf.core.server_types.LegacyGrpcServer object at 0x7f64550113a0>

    @conftest.raises_for_servers_version_under("4.0")
    def test_read_from_txt_data_tree(server_type):
        data_tree = dpf.DataTree(server=server_type)
        with data_tree.to_fill() as to_fill:
            to_fill.int = 1
            to_fill.double = 1.0
            to_fill.string = "hello"
            to_fill.list_int = [1, 2]
            to_fill.list_double = [1.5, 2.5]
            to_fill.add(list_string=["hello", "bye"])
>       txt = data_tree.write_to_txt()

tests/test_data_tree.py:243: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
..../test-api/lib/python3.9.../dpf/core/data_tree.py:300: in write_to_txt
    return self._serialize(path, op)
..../test-api/lib/python3.9.../dpf/core/data_tree.py:269: in _serialize
    return operator.get_output(0, core.types.string)
..../test-api/lib/python3.9.../dpf/core/dpf_operator.py:601: in get_output
    internal_obj = type_tuple[1](self, pin)
..../test-api/lib/python3.9.../dpf/core/dpf_operator.py:323: in _getoutput_string
    out = Operator._getoutput_string_as_bytes(self, pin)
..../test-api/lib/python3.9.../dpf/core/dpf_operator.py:338: in _getoutput_string_as_bytes
    return self._api.operator_getoutput_string(self, pin)
..../test-api/lib/python3.9.../dpf/gate/errors.py:38: in wrapper
    out = func(*args, **kwargs)
..../test-api/lib/python3.9.../dpf/gate/operator_grpcapi.py:351: in operator_getoutput_string
    return OperatorGRPCAPI.get_output_finish(op, request, stype, subtype)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<ansys.dpf.core.operators.serialization.data_tree_to_txt.data_tree_to_txt object at 0x7f64467943a0>, op {
  id {
    id: 15
    server_address: "127.0.0.1:50057"
  }
  name: "data_tree_to_txt"
}
, 'string', '')
kwargs = {}, _InactiveRpcError = <class 'grpc._channel._InactiveRpcError'>
_MultiThreadedRendezvous = <class 'grpc._channel._MultiThreadedRendezvous'>
details = 'DPF issue due to licensing context: execution stopped. Apply Premium context to unlock this capability.'

    @wraps(func)
    def wrapper(*args, **kwargs):
        """Capture gRPC exceptions."""
        from grpc._channel import _InactiveRpcError, _MultiThreadedRendezvous
        try:
            out = func(*args, **kwargs)
        except (_InactiveRpcError, _MultiThreadedRendezvous) as error:
            details = error.details()
            if "object is null in the dataBase" in details:
                raise DPFServerNullObject(details) from None
            elif "Unable to open the following file" in details:
                raise DPFServerException(
                    "The result file could not be found or could not be opened, the server raised an error message: \n" + details) from None
>           raise DPFServerException(details) from None
E           ansys.dpf.gate.errors.DPFServerException: DPF issue due to licensing context: execution stopped. Apply Premium context to unlock this capability.

..../test-api/lib/python3.9.../dpf/gate/errors.py:46: DPFServerException
tests/test_data_tree.py::test_write_to_file_data_tree[ansys-grpc-dpf]
Stack Traces | 0.028s run time
tmpdir = local('.../pydpf-core/pydpf-core/.tox.../pytest-of-runner/pytest-0/test_write_to_file_data_tree_a2')
server_type = <ansys.dpf.core.server_types.LegacyGrpcServer object at 0x7f64550113a0>

    @conftest.raises_for_servers_version_under("4.0")
    def test_write_to_file_data_tree(tmpdir, server_type):
        data_tree = dpf.DataTree(server=server_type)
        with data_tree.to_fill() as to_fill:
            to_fill.int = 1
            to_fill.double = 1.0
            to_fill.string = "hello"
            to_fill.list_int = [1, 2]
            to_fill.list_double = [1.5, 2.5]
            to_fill.list_string = ["hello", "bye"]
>       data_tree.write_to_txt(str(Path(tmpdir) / "file.txt"))

tests/test_data_tree.py:180: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
..../test-api/lib/python3.9.../dpf/core/data_tree.py:300: in write_to_txt
    return self._serialize(path, op)
..../test-api/lib/python3.9.../dpf/core/data_tree.py:260: in _serialize
    operator.run()
..../test-api/lib/python3.9.../dpf/core/dpf_operator.py:778: in run
    self.get_output()
..../test-api/lib/python3.9.../dpf/core/dpf_operator.py:586: in get_output
    return self._api.operator_run(self)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<ansys.dpf.core.operators.serialization.data_tree_to_txt.data_tree_to_txt object at 0x7f642314a0d0>,)
kwargs = {}, _InactiveRpcError = <class 'grpc._channel._InactiveRpcError'>
_MultiThreadedRendezvous = <class 'grpc._channel._MultiThreadedRendezvous'>
details = 'DPF issue due to licensing context: execution stopped. Apply Premium context to unlock this capability.'

    @wraps(func)
    def wrapper(*args, **kwargs):
        """Capture gRPC exceptions."""
        from grpc._channel import _InactiveRpcError, _MultiThreadedRendezvous
        try:
            out = func(*args, **kwargs)
        except (_InactiveRpcError, _MultiThreadedRendezvous) as error:
            details = error.details()
            if "object is null in the dataBase" in details:
                raise DPFServerNullObject(details) from None
            elif "Unable to open the following file" in details:
                raise DPFServerException(
                    "The result file could not be found or could not be opened, the server raised an error message: \n" + details) from None
>           raise DPFServerException(details) from None
E           ansys.dpf.gate.errors.DPFServerException: DPF issue due to licensing context: execution stopped. Apply Premium context to unlock this capability.

..../test-api/lib/python3.9.../dpf/gate/errors.py:46: DPFServerException
test_remote_operator.test_remote_operator::test_connect_3remote_operators
Stack Traces | 6.39s run time
simple_bar = '.../downloaded_examples/result_files/ASimpleBar.rst'

    @pytest.mark.skipif(
        not conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_3_0,
        reason="Connecting data from different servers is " "supported starting server version 3.0",
    )
    def test_connect_3remote_operators(simple_bar):
        data_sources1 = core.DataSources(simple_bar)
        op1 = ops.result.displacement(data_sources=data_sources1)
        data_sources2 = core.DataSources(simple_bar, server=local_servers[0])
        op2 = ops.result.displacement(data_sources=data_sources2, server=local_servers[0])
>       add = ops.math.add_fc(op1, op2, server=local_servers[1])

test_remote_operator/test_remote_operator.py:55: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
test_remote_operator/conftest.py:587: in __getitem__
    self._local_servers.append(core.start_local_server(as_global=False, config=conf))
.../hostedtoolcache/Python/3.9.21............/x64/lib/python3.9.../dpf/core/server.py:255: in start_local_server
    server = server_type(
.../hostedtoolcache/Python/3.9.21............/x64/lib/python3.9.../dpf/core/server_types.py:803: in __init__
    launch_dpf_on_docker(
.../hostedtoolcache/Python/3.9.21............/x64/lib/python3.9.../dpf/core/server_types.py:292: in launch_dpf_on_docker
    _wait_and_check_server_connection(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

process = <Popen: returncode: 125 args: 'docker run -d   -e ANSYS_DPF_ACCEPT_LA=Y  -e ...>
port = 50062, timeout = 20.0, lines = []
current_errors = ['docker: Error response from daemon: driver failed programming external connectivity on endpoint charming_zhukovsky (...44a83558cfd401dfe51fb3e46): Error starting userland proxy: listen tcp4 0.0.0.0:50062: bind: address already in use.\n']
stderr = <function launch_dpf_on_docker.<locals>.read_stderr at 0x7f2d379dd940>
stdout = <function launch_dpf_on_docker.<locals>.read_stdout at 0x7f2d379ddf70>

    def _wait_and_check_server_connection(
        process, port, timeout, lines, current_errors, stderr=None, stdout=None
    ):
        if not stderr:
    
            def read_stderr():
                with io.TextIOWrapper(process.stderr, encoding="utf-8") as log_err:
                    for line in log_err:
                        LOG.debug(line)
                        current_errors.append(line)
    
            stderr = read_stderr
            # check to see if the service started
        if not stdout:
    
            def read_stdout():
                with io.TextIOWrapper(process.stdout, encoding="utf-8") as log_out:
                    for line in log_out:
                        LOG.debug(line)
                        lines.append(line)
    
            stdout = read_stdout
        # must be in the background since the process reader is blocking
        Thread(target=stdout, daemon=True).start()
        Thread(target=stderr, daemon=True).start()
    
        t_timeout = time.time() + timeout
        started = False
        timedout = False
        while not started and len(current_errors) == 0:
            # print(lines)
            started = any("server started" in line for line in lines)
    
            if time.time() > t_timeout:
                if timedout:
                    raise TimeoutError(f"Server did not start in {timeout + timeout} seconds")
                timedout = True
                t_timeout += timeout
    
        # verify there were no errors
        time.sleep(0.01)
        if current_errors:
            try:
                process.kill()
            except PermissionError:
                pass
            errstr = "\n".join(current_errors)
            if (
                "Only one usage of each socket address" in errstr
                or "port is already allocated" in errstr
            ):
                raise errors.InvalidPortError(f"Port {port} in use")
>           raise RuntimeError(errstr)
E           RuntimeError: docker: Error response from daemon: driver failed programming external connectivity on endpoint charming_zhukovsky (6f0203ffc534561b22933865cec391ffc7d231144a83558cfd401dfe51fb3e46): Error starting userland proxy: listen tcp4 0.0.0.0:50062: bind: address already in use.

.../hostedtoolcache/Python/3.9.21............/x64/lib/python3.9.../dpf/core/server_types.py:204: RuntimeError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

PProfizi added a commit that referenced this pull request Mar 19, 2025
…2168)

* Add operator internal name alias for retro

* Limit changes to operators with an alias

* Fix error raising

* update generated code (#2169)

Co-authored-by: PProfizi <100710998+PProfizi@users.noreply.github.com>

* Handle DPFServerException error (remote case)

* Handle DPFServerException error (remote case)

* update generated code (#2173)

Co-authored-by: PProfizi <100710998+PProfizi@users.noreply.github.com>

* Add NMISC and SMISC to operators with aliases

---------

Co-authored-by: PyAnsys CI Bot <92810346+pyansys-ci-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

server-sync DO NOT USE, Related to automatic synchronization with the server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants