Skip to content

Operators in PyDPF Do Not Handle any Type Correctly #1670

@gbenhenia

Description

@gbenhenia

Before submitting the issue

  • I have checked for Compatibility issues
  • I have searched among the existing issues
  • I am using a Python virtual environment

Description of the bug

A bug in PyDPF where an Operator does not correctly handle any type. The operator is supposed to output any type, but it fails to do so. This leads to issues when trying to pass the output of that operator as an input to another operator.

Steps To Reproduce

  1. Create a PyDPF workflow involving the forward operator.
  2. Attempt to pass the output of the forward operator to another operator.
  3. Run the script.

Example Code

from ansys.dpf import core as dpf
from ansys.dpf.core import operators as ops
from ansys.dpf.core import examples

# Load model

model = dpf.Model(examples.find_multishells_rst())

# Define the operators
forward_op_1 = ops.utility.forward()
forward_op_2 = ops.utility.forward()
time_freq_provider_op = ops.metadata.time_freq_provider()

# Define input
ds = dpf.DataSources(examples.find_multishells_rst())
sc= model.metadata.streams_provider

forward_op_1.inputs.any.connect(sc)
forward_op_2.inputs.any.connect(ds)

# Attempt to use forward operator output as input to another operator
try:
    time_freq_provider_op.inputs.streams_container.connect(forward_op_1.outputs.any)
    time_freq_provider_op.inputs.data_sources.connect(forward_op_2.outputs.any)
except TypeError as e:
    print(f"Output connection error: {e}")

Which Operating System causes the issue?

Windows

Which DPF/Ansys version are you using?

Ansys 2024 R1

Which Python version causes the issue?

3.12

Installed packages

annotated-types 0.7.0
ansys-api-platform-instancemanagement 1.1.0
ansys-dpf-core 0.12.1
ansys-dpf-flowdiagram 0.1.0.dev0 D:\flow-diagram\backend
ansys-dpf-post 0.8.0
ansys-platform-instancemanagement 1.1.2
anyio 4.4.0
cachetools 5.3.3
certifi 2024.2.2
charset-normalizer 3.3.2
click 8.1.7
colorama 0.4.6
contourpy 1.2.1
cycler 0.12.1
distlib 0.3.8
dnspython 2.6.1
email_validator 2.1.1
fastapi 0.111.0
fastapi-cli 0.0.4
filelock 3.14.0
fonttools 4.51.0
google-api-core 2.19.0
google-api-python-client 2.130.0
google-auth 2.29.0
google-auth-httplib2 0.2.0
googleapis-common-protos 1.63.0
grpcio 1.64.0
h11 0.14.0
httpcore 1.0.5
httplib2 0.22.0
httptools 0.6.1
httpx 0.27.0
idna 3.7
imageio 2.28.0
imageio-ffmpeg 0.4.9
importlib_metadata 7.1.0
Jinja2 3.1.4
kiwisolver 1.4.5
markdown-it-py 3.0.0
MarkupSafe 2.1.5
matplotlib 3.9.0
mdurl 0.1.2
numpy 1.26.4
orjson 3.10.3
packaging 24.0
pandas 2.2.2
pillow 10.3.0
pip 24.0
platformdirs 4.2.2
pooch 1.8.1
proto-plus 1.23.0
protobuf 4.25.3
psutil 5.9.8
pyasn1 0.6.0
pyasn1_modules 0.4.0
pydantic 2.7.1
pydantic_core 2.18.2
Pygments 2.18.0
pyparsing 3.1.2
python-dateutil 2.9.0.post0
python-dotenv 1.0.1
python-multipart 0.0.9
pytz 2024.1
pyvista 0.43.8
PyYAML 6.0.1
requests 2.32.2
rich 13.7.1
rsa 4.9
scooby 0.10.0
setuptools 70.0.0
shellingham 1.5.4
six 1.16.0
sniffio 1.3.1
starlette 0.37.2
tqdm 4.66.4
typer 0.12.3
typing_extensions 4.12.0
tzdata 2024.1
ujson 5.10.0
uritemplate 4.1.1
urllib3 2.2.1
uvicorn 0.30.0
virtualenv 20.26.2
vtk 9.3.0
watchfiles 0.22.0
websockets 12.0
zipp 3.18.2

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions