Skip to content

fix(doctest): fix retro-compatibility of PropertyField.scoping docstring example #2527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 7, 2025

Conversation

PProfizi
Copy link
Contributor

@PProfizi PProfizi commented Aug 7, 2025

For DPF < 261.
The release pipeline runs the docstring examples against the latest publicly released DPF which is 252.

Effect of the changes on the release pipeline: https://github.com/ansys/pydpf-core/actions/runs/16798597515

@PProfizi PProfizi requested a review from jvidalor August 7, 2025 07:55
@PProfizi PProfizi self-assigned this Aug 7, 2025
@PProfizi PProfizi added the bug Something isn't working label Aug 7, 2025
Copy link

codecov bot commented Aug 7, 2025

❌ 7 Tests Failed:

Tests completed Failed Passed Skipped
43561 7 43554 4344
View the top 3 failed test(s) by shortest run time
tests/test_any.py::test_cast_data_sources_any[gRPC CLayer]
Stack Traces | 0.004s run time
server_type = <ansys.dpf.core.server_types.GrpcServer object at 0x7f345eb37250>

    @pytest.mark.skipif(
        not conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_8_0,
        reason="Requires 24R2.",
    )
    def test_cast_data_sources_any(server_type):
        # Not available through grpc yet
        entity = dpf.DataSources(server=server_type, result_path="test.pth")
>       any_dpf = dpf.Any.new_from(entity)

tests/test_any.py:132: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
..../test-api/lib/python3.10.../dpf/core/any.py:246: in new_from
    any_dpf._internal_obj = type_tuple[0](obj)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

any = <ansys.dpf.core.data_sources.DataSources object at 0x7f342c3c8670>

    @staticmethod
    def any_new_from_data_sources(any):
    	errorSize = ctypes.c_int(0)
    	sError = ctypes.c_wchar_p()
    	res = capi.dll.Any_newFrom_DataSources(any._internal_obj if any is not None else None, 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 Any_newFrom_DataSources

..../test-api/lib/python3.10.../gate/generated/any_capi.py:392: DPFServerException
tests/test_any.py::test_cast_data_sources_any[gRPC CLayer]
Stack Traces | 0.005s run time
server_type = <ansys.dpf.core.server_types.GrpcServer object at 0x7ff4beee1550>

    @pytest.mark.skipif(
        not conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_8_0,
        reason="Requires 24R2.",
    )
    def test_cast_data_sources_any(server_type):
        # Not available through grpc yet
        entity = dpf.DataSources(server=server_type, result_path="test.pth")
>       any_dpf = dpf.Any.new_from(entity)
                  ^^^^^^^^^^^^^^^^^^^^^^^^

tests/test_any.py:132: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
..../test-api/lib/python3.11.../dpf/core/any.py:246: in new_from
    any_dpf._internal_obj = type_tuple[0](obj)
                            ^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

any = <ansys.dpf.core.data_sources.DataSources object at 0x7ff48d984110>

    @staticmethod
    def any_new_from_data_sources(any):
    	errorSize = ctypes.c_int(0)
    	sError = ctypes.c_wchar_p()
    	res = capi.dll.Any_newFrom_DataSources(any._internal_obj if any is not None else None, 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 Any_newFrom_DataSources

..../test-api/lib/python3.11.../gate/generated/any_capi.py:392: DPFServerException
tests\test_any.py::test_any::test_cast_data_sources_any[gRPC CLayer]
Stack Traces | 0.005s run time
server_type = <ansys.dpf.core.server_types.GrpcServer object at 0x0000025397FF8A90>

    @pytest.mark.skipif(
        not conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_8_0,
        reason="Requires 24R2.",
    )
    def test_cast_data_sources_any(server_type):
        # Not available through grpc yet
        entity = dpf.DataSources(server=server_type, result_path="test.pth")
>       any_dpf = dpf.Any.new_from(entity)

tests\test_any.py:132: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox\test-api\lib\site-packages\ansys\dpf\core\any.py:246: in new_from
    any_dpf._internal_obj = type_tuple[0](obj)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

any = <ansys.dpf.core.data_sources.DataSources object at 0x000002539D95FD60>

    @staticmethod
    def any_new_from_data_sources(any):
    	errorSize = ctypes.c_int(0)
    	sError = ctypes.c_wchar_p()
    	res = capi.dll.Any_newFrom_DataSources(any._internal_obj if any is not None else None, 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 Any_newFrom_DataSources

.tox\test-api\lib\site-packages\ansys\dpf\gate\generated\any_capi.py:392: 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.

@PProfizi PProfizi merged commit 4c983c5 into main Aug 7, 2025
95 of 136 checks passed
@PProfizi PProfizi deleted the fix/propertyfield.scoping_doctest_retrocompatiility branch August 7, 2025 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant