Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
ceb7ba8
Make available_operator_names available at root level
PProfizi Jan 8, 2024
f5f9ad8
Add typehint to get_or_create_server
PProfizi Jan 8, 2024
9d008bf
Fix get_api_for_type argument naming
PProfizi Jan 8, 2024
7f7e3f1
Allow GenericDataContainer as output of custom_operator
PProfizi Jan 9, 2024
2e1ad5f
Add test and add GDC as input. Waiting for dpf-site.zip update feature
PProfizi Jan 25, 2024
950780e
Merge branch 'master' into fix/custom_plugin_fixes
PProfizi Jan 25, 2024
382528e
Change update of dpf-site.zip to only change ansys-dpf-core (WIP)
PProfizi Jan 25, 2024
1825753
Update of dpf-site.zip works for non-editable install of ansys-dpf-core
PProfizi Jan 25, 2024
0168154
Use update of dpf-site.zip in test_python_plugins.py
PProfizi Jan 25, 2024
248e988
Fix type_to_input method for generic_data_container in _custom_operat…
PProfizi Jan 26, 2024
34e00a2
Working dpf-site.zip update when ansys-dpf-core installed non-editable
PProfizi Jan 26, 2024
842eeeb
Working update of dpf-site.zip for both editable and non-editable ins…
PProfizi Jan 26, 2024
884e5ec
Merge branch 'master' into fix/custom_plugin_fixes
PProfizi Jan 26, 2024
f85a7ab
Skip test for DPF<7.0
PProfizi Jan 26, 2024
2db78ed
Merge remote-tracking branch 'origin/fix/custom_plugin_fixes' into fi…
PProfizi Jan 26, 2024
8ca296c
Add test_set_get_int_generic_data_container
PProfizi Jan 26, 2024
5219ccc
Revert "Add test_set_get_int_generic_data_container"
PProfizi Jan 26, 2024
0ec64b6
Change operator.get_output to return None when response from server i…
PProfizi Jan 26, 2024
7e11a47
Skip LegacyGrpc in tests on GenericDataContainer as output of an Oper…
PProfizi Jan 26, 2024
36bdaa2
Remove duplicate
PProfizi Jan 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/ansys/dpf/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
from ansys.dpf.core.mesh_info import MeshInfo
from ansys.dpf.core.generic_data_container import GenericDataContainer

from ansys.dpf.core.dpf_operator import available_operator_names

# for matplotlib
# solves "QApplication: invalid style override passed, ignoring it."
Expand Down
6 changes: 5 additions & 1 deletion src/ansys/dpf/core/_custom_operators_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
meshes_container,
result_info,
string_field,
custom_type_field,
custom_type_field, generic_data_container,
)

external_operator_api = external_operator_capi.ExternalOperatorCAPI
Expand Down Expand Up @@ -70,6 +70,10 @@ def __operator_main__(operator_functor, data):
custom_type_field.CustomTypeField,
external_operator_api.external_operator_put_out_custom_type_field,
),
(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PProfizi is it tested somewhere else?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cbellot000 CodeCov says yes, which is weird because it is not tested explicitly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cbellot000 BTW why do we have a type_to_output specific to the custom operators?

Copy link
Contributor Author

@PProfizi PProfizi Jan 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cbellot000 I just realized that to be be able to test this (and for this to even work), the changes need to be propagated to dpf-site.zip.
So either I add the capability to update the dpf-site.zip based on the current venv as we discussed previously, and use it at the start of test_python_plugins.py,
or we have to merge it first, then wait for a server sync loop to put it in dpf-site.zip and only then add the tests.
I'd tend to go towards the first proposal, which means I have to code and merge a PR with the dpf-site.zip update feature before this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1379

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see then, you can maybe add the test ad mark it as skip this way we can remove the skip later?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cbellot000 BTW why do we have a type_to_output specific to the custom operators?

I don't understand, where would you put "external_operator_put_out_generic_data_container" instead?

generic_data_container.GenericDataContainer,
external_operator_api.external_operator_put_out_generic_data_container,
)
]

_type_to_input_method = [
Expand Down
5 changes: 3 additions & 2 deletions src/ansys/dpf/core/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import inspect
import warnings
import traceback
from typing import Union

from ansys import dpf

Expand All @@ -22,7 +23,7 @@
ServerFactory,
CommunicationProtocols,
)
from ansys.dpf.core.server_types import DPF_DEFAULT_PORT, LOCALHOST, RUNNING_DOCKER
from ansys.dpf.core.server_types import DPF_DEFAULT_PORT, LOCALHOST, RUNNING_DOCKER, BaseServer
from ansys.dpf.core import server_context


Expand Down Expand Up @@ -382,7 +383,7 @@ def connect():
raise e


def get_or_create_server(server):
def get_or_create_server(server: BaseServer) -> Union[BaseServer, None]:
"""Returns the given server or if None, creates a new one.

Parameters
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/dpf/core/server_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def available_api_types(self):
pass

@abc.abstractmethod
def get_api_for_type(self, c_api, grpc_api):
def get_api_for_type(self, capi, grpcapi):
pass

@property
Expand Down