Skip to content

Mesh get_connectivity uses deprecated np.in1d #4768

@fredsonnenwald

Description

@fredsonnenwald

🔍 Before submitting the issue

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

🐞 Description of the bug

Numpy 2.4.0 removes the deprecated in1d function (https://numpy.org/doc/stable/release/2.4.0-notes.html#removed-numpy-in1d) that is used in

mask = np.in1d(nodes, key)
causing, e.g.,

  File "venv/lib/python3.12/site-packages/ansys/fluent/core/filereader/case_file.py", line 349, in get_connectivity
    mask = np.in1d(nodes, key)
           ^^^^^^^
  File "venv/lib/python3.12/site-packages/numpy/__init__.py", line 792, in __getattr__
    raise AttributeError(f"module {__name__!r} has no attribute {attr!r}")
AttributeError: module 'numpy' has no attribute 'in1d'

📝 Steps to reproduce

The error can be reproduced following the CaseFile "Extracts mesh data" example at https://fluent.docs.pyansys.com/version/stable/user_guide/offline/case_file.html

from ansys.fluent.core import examples
from ansys.fluent.core.filereader.case_file import CaseFile
case_file_name = examples.download_file("elbow1.cas.h5", "pyfluent/file_session")
reader = CaseFile(case_file_name=case_file_name)
reader.get_mesh().get_connectivity(3)

💻 Which operating system are you using?

Linux

📀 Which ANSYS version are you using?

2025R2, although I believe the error does not care about version as it's in the file reader side of things.

🐍 Which Python version are you using?

3.12

📦 Installed packages

annotated-doc==0.0.4
annotated-types==0.7.0
ansys-acp-core==0.3.0
ansys-additive-core==0.20.0
ansys-api-acp==0.3.1
ansys-api-additive==5.0.3
ansys-api-dbu==0.3.28
ansys-api-discovery==1.0.14
ansys-api-dyna==0.4.2
ansys-api-edb==0.2.1
ansys-api-fluent==0.3.36
ansys-api-geometry==0.4.89
ansys-api-mapdl==0.5.2
ansys-api-mechanical==0.1.3
ansys-api-meshing-prime==0.1.4
ansys-api-modelcenter==0.3.1
ansys-api-platform-instancemanagement==1.1.3
ansys-api-pyensight==0.4.7
ansys-api-sherlock==0.1.46
ansys-api-speos==0.15.2
ansys-api-systemcoupling==0.2.0
ansys-api-tools-filetransfer==0.1.2
ansys-api-workbench==0.2.0
ansys-conceptev-core==0.9.4
ansys-dpf-composites==0.7.0
ansys-dpf-core==0.14.1
ansys-dpf-post==0.10.0
ansys-dyna-core==0.9.0
ansys-dynamicreporting-core==0.10.1
ansys-edb-core==0.2.3
ansys-engineeringworkflow-api==0.1.0
ansys-fluent-core==0.37.1
ansys-fluent-visualization==0.21.1
ansys-geometry-core==0.14.1
ansys-grantami-bomanalytics==2.3.1
ansys-grantami-bomanalytics-openapi==4.0.0
ansys-grantami-jobqueue==1.2.0
ansys-grantami-recordlists==2.0.1
ansys-grantami-serverapi-openapi==5.0.0
ansys-hps-client==0.10.1
ansys-hps-data-transfer-client==0.2.1
ansys-mapdl-core==0.70.2
ansys-mapdl-reader==0.55.1
ansys-math-core==0.2.4
ansys-mechanical-core==0.11.30
ansys-mechanical-env==0.1.16
ansys-mechanical-stubs==0.1.6
ansys-meshing-prime==0.9.1
ansys-modelcenter-workflow==0.1.1
ansys-motorcad-core==0.7.4
ansys-openapi-common==2.3.2
ansys-optislang-core==1.0.0
ansys-platform-instancemanagement==1.1.2
ansys-pyensight-core==0.10.0.post1
ansys-pythonnet==3.1.0rc6
ansys-rocky-core==0.3.2
ansys-seascape==0.2.0
ansys-sherlock-core==0.9.0
ansys-simai-core==0.3.3
ansys-sound-core==0.2.1
ansys-speos-core==0.6.0
ansys-stk==0.2.1
ansys-systemcoupling-core==0.11.2
ansys-tools-common==0.4.0
ansys-tools-filetransfer==0.2.1
ansys-tools-local-product-launcher==0.2.0
ansys-tools-path==0.8.1
ansys-turbogrid-api==0.5.5
ansys-turbogrid-core==0.4.6
ansys-units==0.9.1
ansys-workbench-core==0.9.0
anyio==4.12.0
appdirs==1.4.4
asgiref==3.11.0
asttokens==3.0.1
asyncio-atexit==1.0.1
attrs==25.4.0
backoff==2.2.1
bcrypt==5.0.0
beartype==0.22.8
build==1.3.0
cachetools==6.2.2
certifi==2025.11.12
cffi==1.17.1
cfgv==3.5.0
chardet==5.2.0
charset-normalizer==3.4.4
click==8.3.1
clr_loader==0.2.9
comtypes==1.4.13
contourpy==1.3.3
coverage==7.13.0
cryptography==46.0.0
cycler==0.12.1
dataclasses-json==0.6.7
decorator==5.2.1
deepdiff==8.6.1
defusedxml==0.7.1
Deprecated==1.3.1
dill==0.4.0
distlib==0.4.0
distro==1.9.0
Django==4.2.27
django-guardian==2.4.0
djangorestframework==3.16.1
dnspython==2.8.0
docker==7.1.0
docutils==0.22.3
dotnetcore2==3.1.23
elementpath==5.0.4
email-validator==2.3.0
executing==2.2.1
fabric==3.2.2
fast_simplification==0.1.13
fastapi==0.124.2
fastapi-cli==0.0.16
fastapi-cloud-cli==0.6.0
fastar==0.8.0
filelock==3.20.0
flexcache==0.3
flexparser==0.4
fonttools==4.61.0
geomdl==5.4.0
google-api-core==2.28.1
google-api-python-client==2.187.0
google-auth==2.43.0
google-auth-httplib2==0.2.1
googleapis-common-protos==1.72.0
grpcio==1.76.0
grpcio-health-checking==1.62.3
grpcio-status==1.62.3
h11==0.16.0
h5py==3.14.0
hollerith==0.6.0
httpcore==1.0.9
httplib2==0.31.0
httptools==0.7.1
httpx==0.27.2
humanfriendly==10.0
identify==2.6.15
idna==3.11
importlib_metadata==8.7.1
iniconfig==2.3.0
invoke==2.2.1
ipython==9.8.0
ipython_pygments_lexers==1.1.1
jaraco.functools==4.3.0
jedi==0.19.2
jeepney==0.9.0
jh2==5.0.10
Jinja2==3.1.6
joblib==1.5.3
jsonschema==4.25.1
jsonschema-specifications==2025.9.1
kiwisolver==1.4.9
lxml==6.0.2
markdown-it-py==4.0.0
MarkupSafe==3.0.3
marshmallow==3.26.1
marshmallow-oneofschema==3.2.0
matplotlib==3.10.7
matplotlib-inline==0.2.1
mdurl==0.1.2
more-itertools==10.8.0
msal==1.34.0
msal-extensions==1.3.1
mypy_extensions==1.1.0
networkx==3.6.1
niquests==3.15.2
nltk==3.9.2
nodeenv==1.9.1
numpy==2.4.0
orderly-set==5.5.0
overrides==7.7.0
packaging==25.0
pandas==2.3.3
paramiko==4.0.0
parso==0.8.5
patsy==1.0.2
pexpect==4.9.0
pillow==12.0.0
Pint==0.25.2
platformdirs==4.5.1
pluggy==1.6.0
pooch==1.8.2
portend==3.2.1
pre_commit==4.5.0
prompt_toolkit==3.0.52
proto-plus==1.26.1
protobuf==4.25.8
psutil==7.1.3
psycopg==3.3.2
psycopg-binary==3.3.2
ptyprocess==0.7.0
pure_eval==0.2.3
pyaedt==0.23.0
pyansys==2025.2.3
pyansys-tools-report==0.9.0
pyansys-tools-variableinterop==0.1.1
pyansys-tools-versioning==0.7.0
pyasn1==0.6.1
pyasn1_modules==0.4.2
pycparser==2.23
pydantic==2.11.10
pydantic-settings==2.12.0
pydantic_core==2.33.2
pyedb==0.54.0
pygltflib==1.16.5
Pygments==2.19.2
pygranta==2025.2.1
pyiges==0.3.2
PyJWT==2.10.1
PyNaCl==1.6.0
pyparsing==3.2.5
pypng==0.20220715.0
pyproject_hooks==1.2.0
Pyro5==5.15
pyspnego==0.12.0
pytest==9.0.2
pytest-cov==7.0.0
pytest-dependency==0.6.0
pytest-order==1.3.0
python-dateutil==2.9.0.post0
python-dotenv==1.2.1
python-multipart==0.0.20
python-pptx==0.6.19
pytwin==0.9.2
pytz==2025.2
pyvista==0.46.4
PyYAML==6.0.3
qh3==1.5.6
referencing==0.37.0
regex==2025.11.3
requests==2.32.5
requests-toolbelt==1.0.0
requests_ntlm==1.3.0
rich==14.2.0
rich-toolkit==0.17.0
rignore==0.7.6
rpds-py==0.30.0
rsa==4.9.1
rtree==1.4.1
ruff==0.14.8
scikit-rf==1.9.0
scipy==1.16.3
scooby==0.11.0
semver==3.0.4
sentry-sdk==2.47.0
serpent==1.42
setuptools==80.9.0
shapely==2.1.2
shellingham==1.5.4
six==1.17.0
sniffio==1.3.1
sqlparse==0.5.4
sseclient-py==1.8.0
stack-data==0.6.3
starlette==0.50.0
statsmodels==0.14.6
tabulate==0.9.0
tempora==5.8.1
tenacity==8.5.0
toml==0.10.2
tomli==2.3.0
tomli_w==1.2.0
tqdm==4.67.1
traitlets==5.14.3
transformations==2025.1.1
truststore==0.10.4
typer==0.20.0
typing-inspect==0.9.0
typing-inspection==0.4.2
typing_extensions==4.15.0
tzdata==2025.3
tzlocal==5.3.1
uritemplate==4.2.0
urllib3==2.6.2
urllib3-future==2.14.908
usd-core==24.8
uv==0.9.17
uvicorn==0.38.0
uvloop==0.22.1
virtualenv==20.35.4
vtk==9.5.2
wakepy==0.10.2.post1
wassima==2.0.2
watchfiles==1.1.1
wcwidth==0.2.14
websockets==15.0.1
wrapt==2.0.1
xlsxwriter==3.2.9
xmlschema==4.2.0
zipp==3.23.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue, problem or error in PyFluent

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions