Skip to content

Commit b198e6d

Browse files
authored
Merge branch 'main' into feat/load_library_default_name
2 parents a768b3f + 7bc7a1a commit b198e6d

File tree

19 files changed

+210
-90
lines changed

19 files changed

+210
-90
lines changed

.github/workflows/pydpf-post.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ jobs:
152152
PACKAGE_NAME: ansys-dpf-post
153153
working-directory: pydpf-post/src
154154
if: inputs.test_docstrings == 'true'
155-
timeout-minutes: 10
155+
timeout-minutes: 12
156156
continue-on-error: true
157157

158158
- uses: mainmatter/continue-on-error-comment@v1

doc/source/_static/dpf_operators.html

Lines changed: 45 additions & 45 deletions
Large diffs are not rendered by default.

doc/source/getting_started/contribute/developer.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,10 @@ Testing on Linux via WSL
254254
Some system dependencies required for VTK to run properly might be missing when running tests on linux via WSL (or even linux in general).
255255
The identified workaround for this is to install the OSMesa wheel variant that leverages offscreen rendering with OSMesa.
256256
This wheel is being built for both Linux and Windows at this time and bundles all of the necessary libraries into the wheel. This is
257-
achieved by adding ``-x testenv.commands_pre="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==<version>"``
257+
achieved by adding ``-x testenv.commands_pre="uv pip install --index-url https://wheels.vtk.org vtk-osmesa==<version>"``
258258

259259
For example, to run all tests sequentially on linux, while using a Standalone DPF Server whose path is ``ansys_dpf_server_lin_v2025.1.pre0``, simply run:
260260

261261
.. code-block:: text
262262
263-
python -m tox --parallel -x testenv.deps+="-e ansys_dpf_server_lin_v2025.1.pre0" -x testenv.commands_pre="uv pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"
263+
python -m tox --parallel -x testenv.deps+="-e ansys_dpf_server_lin_v2025.1.pre0" -x testenv.commands_pre="uv pip install --index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0"

doc/source/user_guide/tutorials/custom_operators_and_plugins/update_pydpf_core.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ installer's Python interpreter.
1414

1515
- ``-awp_root``: Path to the Ansys root installation folder. For example, the 2023 R1 installation folder ends
1616
with ``Ansys Inc/v231``, and the default environment variable is ``AWP_ROOT231``.
17-
- ``-pip_args``: Optional arguments to add to the ``pip`` command. For example, ``--extra-index-url`` or
17+
- ``-pip_args``: Optional arguments to add to the ``pip`` command. For example, ``--index-url`` or
1818
``--trusted-host``.
1919

2020
If you ever want to uninstall the ``ansys-dpf-core`` module from the Ansys installation, you can do so.

src/ansys/dpf/gate/dpf_vector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(self, owner, api):
4545
if not server_meet_version("4.1",
4646
owner._server) and owner._server.client is None: # BUG in 22.2: DpfVector is not holding the data owner and not call to data owner should be done at delete
4747
self._modified = False
48-
except ctypes.ArgumentError:
48+
except (ctypes.ArgumentError, AttributeError):
4949
raise NotImplementedError
5050

5151
@property

src/ansys/dpf/gate/generated/capi.py

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2063,6 +2063,14 @@ def load_api(path):
20632063
dll.CSField_GetEntityIndex.argtypes = (ctypes.c_void_p, ctypes.c_int32, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
20642064
dll.CSField_GetEntityIndex.restype = ctypes.c_int32
20652065

2066+
if hasattr(dll, "CSField_SetHeaderAsDataTree"):
2067+
dll.CSField_SetHeaderAsDataTree.argtypes = (ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
2068+
dll.CSField_SetHeaderAsDataTree.restype = None
2069+
2070+
if hasattr(dll, "CSField_GetHeaderAsDataTree"):
2071+
dll.CSField_GetHeaderAsDataTree.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
2072+
dll.CSField_GetHeaderAsDataTree.restype = ctypes.c_void_p
2073+
20662074
if hasattr(dll, "CSField_GetData_For_DpfVector"):
20672075
dll.CSField_GetData_For_DpfVector.argtypes = (ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.POINTER(ctypes.c_double)), ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
20682076
dll.CSField_GetData_For_DpfVector.restype = None
@@ -4250,6 +4258,10 @@ def load_api(path):
42504258
dll.CSCustomTypeField_GetEntityIndex.argtypes = (ctypes.c_void_p, ctypes.c_int32, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
42514259
dll.CSCustomTypeField_GetEntityIndex.restype = ctypes.c_int32
42524260

4261+
if hasattr(dll, "CSCustomTypeField_SetHeaderAsDataTree"):
4262+
dll.CSCustomTypeField_SetHeaderAsDataTree.argtypes = (ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
4263+
dll.CSCustomTypeField_SetHeaderAsDataTree.restype = None
4264+
42534265
if hasattr(dll, "CSCustomTypeField_new_on_client"):
42544266
dll.CSCustomTypeField_new_on_client.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.c_char), ctypes.c_int32, ctypes.c_int32, ctypes.c_int32, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
42554267
dll.CSCustomTypeField_new_on_client.restype = ctypes.c_void_p
@@ -5086,13 +5098,9 @@ def load_api(path):
50865098
dll.FbsRef_new.restype = ctypes.c_void_p
50875099

50885100
if hasattr(dll, "FbsRef_getFromDB"):
5089-
dll.FbsRef_getFromDB.argtypes = (ctypes.c_size_t, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
5101+
dll.FbsRef_getFromDB.argtypes = (ctypes.c_void_p, ctypes.c_size_t, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
50905102
dll.FbsRef_getFromDB.restype = ctypes.c_void_p
50915103

5092-
if hasattr(dll, "FbsRef_getID"):
5093-
dll.FbsRef_getID.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
5094-
dll.FbsRef_getID.restype = ctypes.c_size_t
5095-
50965104
if hasattr(dll, "Any_getAs_FbsRef"):
50975105
dll.Any_getAs_FbsRef.argtypes = (ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_char), ctypes.c_void_p, ctypes.POINTER(ctypes.c_size_t), ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
50985106
dll.Any_getAs_FbsRef.restype = None
@@ -5101,6 +5109,18 @@ def load_api(path):
51015109
dll.FbsRef_StartOrGetThreadServer.argtypes = (ctypes.c_bool, ctypes.POINTER(ctypes.c_char), ctypes.c_int32, ctypes.POINTER(ctypes.c_char), ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
51025110
dll.FbsRef_StartOrGetThreadServer.restype = ctypes.c_void_p
51035111

5112+
if hasattr(dll, "Fbs_GetBytesBufferFromSlice"):
5113+
dll.Fbs_GetBytesBufferFromSlice.argtypes = (ctypes.c_void_p, ctypes.c_size_t, ctypes.POINTER(ctypes.c_size_t), ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
5114+
dll.Fbs_GetBytesBufferFromSlice.restype = ctypes.c_void_p
5115+
5116+
if hasattr(dll, "Fbs_DeleteChannel"):
5117+
dll.Fbs_DeleteChannel.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
5118+
dll.Fbs_DeleteChannel.restype = None
5119+
5120+
if hasattr(dll, "Fbs_DeleteSlice"):
5121+
dll.Fbs_DeleteSlice.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
5122+
dll.Fbs_DeleteSlice.restype = None
5123+
51045124
if hasattr(dll, "FbsRef_new_on_client"):
51055125
dll.FbsRef_new_on_client.argtypes = (ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_char), ctypes.c_void_p, ctypes.c_size_t, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
51065126
dll.FbsRef_new_on_client.restype = ctypes.c_void_p

src/ansys/dpf/gate/generated/custom_type_field_abstract_api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ def cscustom_type_field_get_entity_id(field, index):
131131
def cscustom_type_field_get_entity_index(field, id):
132132
raise NotImplementedError
133133

134+
@staticmethod
135+
def cscustom_type_field_set_header_as_data_tree(field, header):
136+
raise NotImplementedError
137+
134138
@staticmethod
135139
def cscustom_type_field_new_on_client(client, type, unitarySize, numEntities, numUnitaryData):
136140
raise NotImplementedError

src/ansys/dpf/gate/generated/custom_type_field_capi.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,15 @@ def cscustom_type_field_get_entity_index(field, id):
289289
raise errors.DPFServerException(sError.value)
290290
return res
291291

292+
@staticmethod
293+
def cscustom_type_field_set_header_as_data_tree(field, header):
294+
errorSize = ctypes.c_int(0)
295+
sError = ctypes.c_wchar_p()
296+
res = capi.dll.CSCustomTypeField_SetHeaderAsDataTree(field._internal_obj if field is not None else None, header._internal_obj if header is not None else None, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
297+
if errorSize.value != 0:
298+
raise errors.DPFServerException(sError.value)
299+
return res
300+
292301
@staticmethod
293302
def cscustom_type_field_new_on_client(client, type, unitarySize, numEntities, numUnitaryData):
294303
errorSize = ctypes.c_int(0)

src/ansys/dpf/gate/generated/fbs_ref_abstract_api.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,27 @@ def fbs_ref_new(client, channel_address, req_slice, req_offset):
1616
raise NotImplementedError
1717

1818
@staticmethod
19-
def fbs_ref_get_from_db(id):
19+
def fbs_ref_get_from_db(ptr, size):
2020
raise NotImplementedError
2121

2222
@staticmethod
23-
def fbs_ref_get_id(obj):
23+
def any_get_as_fbs_ref(obj, client, channel_address, req_slice, req_offset):
2424
raise NotImplementedError
2525

2626
@staticmethod
27-
def any_get_as_fbs_ref(obj, client, channel_address, req_slice, req_offset):
27+
def fbs_ref_start_or_get_thread_server(get_existing, ip, port, address):
2828
raise NotImplementedError
2929

3030
@staticmethod
31-
def fbs_ref_start_or_get_thread_server(get_existing, ip, port, address):
31+
def fbs_get_bytes_buffer_from_slice(req_slice, req_offset, size_out):
32+
raise NotImplementedError
33+
34+
@staticmethod
35+
def fbs_delete_channel(client):
36+
raise NotImplementedError
37+
38+
@staticmethod
39+
def fbs_delete_slice(req_slice):
3240
raise NotImplementedError
3341

3442
@staticmethod

src/ansys/dpf/gate/generated/fbs_ref_capi.py

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,37 +27,55 @@ def fbs_ref_new(client, channel_address, req_slice, req_offset):
2727
return res
2828

2929
@staticmethod
30-
def fbs_ref_get_from_db(id):
30+
def fbs_ref_get_from_db(ptr, size):
3131
errorSize = ctypes.c_int(0)
3232
sError = ctypes.c_wchar_p()
33-
res = capi.dll.FbsRef_getFromDB(id, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
33+
res = capi.dll.FbsRef_getFromDB(ptr, size, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
3434
if errorSize.value != 0:
3535
raise errors.DPFServerException(sError.value)
3636
return res
3737

3838
@staticmethod
39-
def fbs_ref_get_id(obj):
39+
def any_get_as_fbs_ref(obj, client, channel_address, req_slice, req_offset):
4040
errorSize = ctypes.c_int(0)
4141
sError = ctypes.c_wchar_p()
42-
res = capi.dll.FbsRef_getID(obj._internal_obj if obj is not None else None, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
42+
res = capi.dll.Any_getAs_FbsRef(obj._internal_obj if obj is not None else None, client, utils.to_char_ptr(channel_address), req_slice, req_offset, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
4343
if errorSize.value != 0:
4444
raise errors.DPFServerException(sError.value)
4545
return res
4646

4747
@staticmethod
48-
def any_get_as_fbs_ref(obj, client, channel_address, req_slice, req_offset):
48+
def fbs_ref_start_or_get_thread_server(get_existing, ip, port, address):
4949
errorSize = ctypes.c_int(0)
5050
sError = ctypes.c_wchar_p()
51-
res = capi.dll.Any_getAs_FbsRef(obj._internal_obj if obj is not None else None, client, utils.to_char_ptr(channel_address), req_slice, req_offset, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
51+
res = capi.dll.FbsRef_StartOrGetThreadServer(get_existing, utils.to_char_ptr(ip), utils.to_int32(port), utils.to_char_ptr(address), ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
5252
if errorSize.value != 0:
5353
raise errors.DPFServerException(sError.value)
5454
return res
5555

5656
@staticmethod
57-
def fbs_ref_start_or_get_thread_server(get_existing, ip, port, address):
57+
def fbs_get_bytes_buffer_from_slice(req_slice, req_offset, size_out):
5858
errorSize = ctypes.c_int(0)
5959
sError = ctypes.c_wchar_p()
60-
res = capi.dll.FbsRef_StartOrGetThreadServer(get_existing, utils.to_char_ptr(ip), utils.to_int32(port), utils.to_char_ptr(address), ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
60+
res = capi.dll.Fbs_GetBytesBufferFromSlice(req_slice, req_offset, size_out, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
61+
if errorSize.value != 0:
62+
raise errors.DPFServerException(sError.value)
63+
return res
64+
65+
@staticmethod
66+
def fbs_delete_channel(client):
67+
errorSize = ctypes.c_int(0)
68+
sError = ctypes.c_wchar_p()
69+
res = capi.dll.Fbs_DeleteChannel(client, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
70+
if errorSize.value != 0:
71+
raise errors.DPFServerException(sError.value)
72+
return res
73+
74+
@staticmethod
75+
def fbs_delete_slice(req_slice):
76+
errorSize = ctypes.c_int(0)
77+
sError = ctypes.c_wchar_p()
78+
res = capi.dll.Fbs_DeleteSlice(req_slice, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
6179
if errorSize.value != 0:
6280
raise errors.DPFServerException(sError.value)
6381
return res

0 commit comments

Comments
 (0)