Skip to content

Expose operator version, and setter for custom Operators #2153

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ansys-akarcher
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Mar 17, 2025

❌ 27 Tests Failed:

Tests completed Failed Passed Skipped
22867 27 22840 3324
View the top 3 failed test(s) by shortest run time
tests\test_python_plugins.py::test_python_plugins::test_custom_op_with_version
Stack Traces | 0.011s run time
testfiles_dir = 'D:\\a\\pydpf-core\\pydpf-core\\tests\\testfiles'

    def test_custom_op_with_version(testfiles_dir):
>       dpf.load_library(
            dpf.path_utilities.to_server_os(
                Path(testfiles_dir) / "pythonPlugins",
            ),
            "py_operator_with_spec",
            "load_operators"
        )

tests\test_python_plugins.py:426: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox\test-api\lib\site-packages\ansys\dpf\core\core.py:95: in load_library
    base.load_library(filename, name, symbol, generate_operators)
.tox\test-api\lib\site-packages\ansys\dpf\core\core.py:417: in load_library
    self._internal_obj = self._api.data_processing_load_library_on_client(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

sLibraryKey = 'py_operator_with_spec'
sDllPath = 'D:\\a\\pydpf-core\\pydpf-core\\tests\\testfiles\\pythonPlugins'
sloader_symbol = 'load_operators'
client = <ansys.dpf.core.server_types.GrpcClient object at 0x00000276EF6B42E0>

    @staticmethod
    def data_processing_load_library_on_client(sLibraryKey, sDllPath, sloader_symbol, client):
    	errorSize = ctypes.c_int(0)
    	sError = ctypes.c_wchar_p()
    	res = capi.dll.DataProcessing_load_library_on_client(utils.to_char_ptr(sLibraryKey), utils.to_char_ptr(sDllPath), utils.to_char_ptr(sloader_symbol), client._internal_obj if client 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: a 'data processing core error' error occurred: error code 4:DPF error - runtime error: <class 'AttributeError'>; <class 'AttributeError'>: AttributeError("function 'SemanticVersion_new' not found")

.tox\test-api\lib\site-packages\ansys\dpf\gate\generated\data_processing_capi.py:389: DPFServerException
tests\test_python_plugins.py::test_python_plugins::test_custom_op_with_version
Stack Traces | 0.011s run time
testfiles_dir = 'D:\\a\\pydpf-core\\pydpf-core\\tests\\testfiles'

    def test_custom_op_with_version(testfiles_dir):
>       dpf.load_library(
            dpf.path_utilities.to_server_os(
                Path(testfiles_dir) / "pythonPlugins",
            ),
            "py_operator_with_spec",
            "load_operators"
        )

tests\test_python_plugins.py:426: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox\test-api\lib\site-packages\ansys\dpf\core\core.py:95: in load_library
    base.load_library(filename, name, symbol, generate_operators)
.tox\test-api\lib\site-packages\ansys\dpf\core\core.py:417: in load_library
    self._internal_obj = self._api.data_processing_load_library_on_client(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

sLibraryKey = 'py_operator_with_spec'
sDllPath = 'D:\\a\\pydpf-core\\pydpf-core\\tests\\testfiles\\pythonPlugins'
sloader_symbol = 'load_operators'
client = <ansys.dpf.core.server_types.GrpcClient object at 0x000002628BF866B0>

    @staticmethod
    def data_processing_load_library_on_client(sLibraryKey, sDllPath, sloader_symbol, client):
    	errorSize = ctypes.c_int(0)
    	sError = ctypes.c_wchar_p()
    	res = capi.dll.DataProcessing_load_library_on_client(utils.to_char_ptr(sLibraryKey), utils.to_char_ptr(sDllPath), utils.to_char_ptr(sloader_symbol), client._internal_obj if client 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: a 'data processing core error' error occurred: error code 4:DPF error - runtime error: <class 'AttributeError'>; <class 'AttributeError'>: AttributeError("function 'SemanticVersion_new' not found")

.tox\test-api\lib\site-packages\ansys\dpf\gate\generated\data_processing_capi.py:389: DPFServerException
tests\test_python_plugins.py::test_python_plugins::test_custom_op_with_version
Stack Traces | 0.011s run time
testfiles_dir = 'D:\\a\\pydpf-core\\pydpf-core\\tests\\testfiles'

    def test_custom_op_with_version(testfiles_dir):
        dpf.load_library(
            dpf.path_utilities.to_server_os(
                Path(testfiles_dir) / "pythonPlugins",
            ),
            "py_operator_with_spec",
            "load_operators"
        )
        spec = Specification("__op_with_version")
>       assert spec.version == "2.3.1"

tests\test_python_plugins.py:434: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox\test-api\lib\site-packages\ansys\dpf\core\operator_specification.py:504: in version
    semver_obj._internal_obj = self._api.operator_specification_get_version(self)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

specification = <ansys.dpf.core.operator_specification.Specification object at 0x000001C6C37CD990>

    @staticmethod
    def operator_specification_get_version(specification):
    	errorSize = ctypes.c_int(0)
    	sError = ctypes.c_wchar_p()
    	res = capi.dll.Operator_specification_GetVersion(specification._internal_obj if specification 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 Operator_specification_GetVersion

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

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.

2 participants