Skip to content

Conversation

@AnsMelanie
Copy link
Contributor

Hi @ansMHanmer,

Thanks for the review!

@AnsMelanie AnsMelanie requested a review from ansMHanmer July 3, 2025 09:04
@AnsMelanie AnsMelanie requested a review from a team as a code owner July 3, 2025 09:04
@codecov
Copy link

codecov bot commented Jul 3, 2025

❌ 3 Tests Failed:

Tests completed Failed Passed Skipped
25844 3 25841 3677
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.017s run time
server_type = <ansys.dpf.core.server_types.LegacyGrpcServer object at 0x7f5f32da3130>

    @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.10.../dpf/core/data_tree.py:300: in write_to_txt
    return self._serialize(path, op)
..../test-api/lib/python3.10.../dpf/core/data_tree.py:269: in _serialize
    return operator.get_output(0, core.types.string)
..../test-api/lib/python3.10.../dpf/core/dpf_operator.py:603: in get_output
    internal_obj = type_tuple[1](self, pin)
..../test-api/lib/python3.10.../dpf/core/dpf_operator.py:325: in _getoutput_string
    out = Operator._getoutput_string_as_bytes(self, pin)
..../test-api/lib/python3.10.../dpf/core/dpf_operator.py:340: in _getoutput_string_as_bytes
    return self._api.operator_getoutput_string(self, pin)
..../test-api/lib/python3.10.../dpf/gate/errors.py:38: in wrapper
    out = func(*args, **kwargs)
..../test-api/lib/python3.10.../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 0x7f5f32dc1660>, op {
  id {
    id: 7696
    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.10.../dpf/gate/errors.py:46: DPFServerException
tests/test_data_tree.py::test_write_to_file_data_tree[ansys-grpc-dpf]
Stack Traces | 0.023s 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 0x7f5f32da3130>

    @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.10.../dpf/core/data_tree.py:300: in write_to_txt
    return self._serialize(path, op)
..../test-api/lib/python3.10.../dpf/core/data_tree.py:260: in _serialize
    operator.run()
..../test-api/lib/python3.10.../dpf/core/dpf_operator.py:780: in run
    self.get_output()
..../test-api/lib/python3.10.../dpf/core/dpf_operator.py:588: 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 0x7f5f525b8ac0>,)
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.10.../dpf/gate/errors.py:46: DPFServerException
tests/test_cff.py::test_results_fluent[ansys-grpc-dpf]
Stack Traces | 3.14s run time
fluent_mixing_elbow_steady_state = <function fluent_mixing_elbow_steady_state.<locals>.return_ds at 0x7f5f527989d0>
server_type = <ansys.dpf.core.server_types.LegacyGrpcServer object at 0x7f5f32da3130>

    @pytest.mark.skipif(
        not conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_7_0,
        reason="CFF source operators where not supported before 7.0,",
    )
    def test_results_fluent(fluent_mixing_elbow_steady_state, server_type):
        model = dpf.Model(fluent_mixing_elbow_steady_state(server=server_type), server=server_type)
        # print(model)
        result_names = [
            "epsilon",
            "enthalpy",
            "turbulent_kinetic_energy",
            "mach_number",
            "mass_flow_rate",
            "dynamic_viscosity",
            "turbulent_viscosity",
            "static_pressure",
            "surface_heat_rate",
            "density",
            "temperature",
            "velocity",
            "y_plus",
        ]
        for result_name in result_names:
            result_op = getattr(model.results, result_name)()
>           result = result_op.eval()

tests/test_cff.py:98: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
..../test-api/lib/python3.10.../dpf/core/dpf_operator.py:811: in eval
    return self.outputs._outputs[0]()
..../test-api/lib/python3.10.../dpf/core/outputs.py:103: in __call__
    return self.get_data()
..../test-api/lib/python3.10.../dpf/core/outputs.py:82: in get_data
    output = self._operator.get_output(self._pin, type_output)
..../test-api/lib/python3.10.../dpf/core/dpf_operator.py:593: in get_output
    internal_obj = type_tuple[1](self, pin)
..../test-api/lib/python3.10.../dpf/gate/errors.py:38: in wrapper
    out = func(*args, **kwargs)
..../test-api/lib/python3.10.../dpf/gate/operator_grpcapi.py:295: in operator_getoutput_fields_container
    return OperatorGRPCAPI.get_output_finish(op, request, stype, subtype)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<ansys.dpf.core.operators.result.surface_heat_rate.surface_heat_rate object at 0x7f5f32de3580>, op {
  id {
    id: 7236
    server_address: "127.0.0.1:50057"
  }
  name: "Q"
}
type: COLLECTION
subtype: FIELD
, 'collection', 'field')
kwargs = {}, _InactiveRpcError = <class 'grpc._channel._InactiveRpcError'>
_MultiThreadedRendezvous = <class 'grpc._channel._MultiThreadedRendezvous'>
details = 'Q:729<-cff::cas::Q:732<-error code 4:DPF error - runtime error: dpf core function call; 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: Q:729<-cff::cas::Q:732<-error code 4:DPF error - runtime error: dpf core function call; DPF issue due to licensing context: execution stopped. Apply Premium context to unlock this capability.

..../test-api/lib/python3.10.../dpf/gate/errors.py:46: DPFServerException

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

@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2025

The documentation for this pull request will be available at https://dpf.docs.pyansys.com/pull/2409. Please allow some time for the documentation to be deployed.

@ansMHanmer
Copy link
Contributor

Hey @AnsMelanie, I went ahead and made a few changes to ensure everything looks good on my end - 6b5e317 has the details.

I essentially just removed a noisy print statement and ensure that the necessary filepaths were committed to the repo, and ensured the templates were where the script expects them to be. Looks good from my end now. Feel free to merge

ansMHanmer
ansMHanmer previously approved these changes Jul 3, 2025
@PProfizi
Copy link
Contributor

PProfizi commented Jul 4, 2025

Hi @AnsMelanie I do not see the version or changelog in the operator_doc_template.md, is that normal?

@AnsMelanie
Copy link
Contributor Author

@PProfizi

I see the old template. I don't understand what happened. I'll check on Monday.

@ansMHanmer
Copy link
Contributor

@AnsMelanie this is definitely something I did, I can take a look tomorrow.

@ansMHanmer ansMHanmer self-requested a review July 7, 2025 13:34
@ansMHanmer ansMHanmer dismissed their stale review July 7, 2025 14:42

Many changes since the initial review, it is not a valid approval any longer

@PProfizi PProfizi changed the base branch from mhanmer/operator_doc_template to master July 9, 2025 08:41
@PProfizi PProfizi force-pushed the AnsMelanie/op-doc-custom branch from 0526940 to 6b7e053 Compare July 9, 2025 09:07
@PProfizi
Copy link
Contributor

PProfizi commented Jul 9, 2025

Now dealt with in #2423

@PProfizi PProfizi closed this Jul 9, 2025
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

Successfully merging this pull request may close these issues.

4 participants