Skip to content
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

003_short_fiber_example #383

Open
2 tasks done
MNymannG opened this issue Nov 13, 2023 · 13 comments
Open
2 tasks done

003_short_fiber_example #383

MNymannG opened this issue Nov 13, 2023 · 13 comments
Labels
bug Something isn't working

Comments

@MNymannG
Copy link

🔍 Before submitting the issue

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

🐞 Description of the bug

Directly downloading short fiber example and running it yields the following import error. Seems something in data_sources has not been updated along with example code from previous version.

runfile('C:/Users/104121/Anisotropic_test/003_short_fiber_example.py', wdir='C:/Users/104121/Anisotropic_test')
Traceback (most recent call last):

File C:\pyansysvenv\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
exec(code, globals, locals)

File c:\users\104121\anisotropic_test\003_short_fiber_example.py:34
from ansys.dpf.composites.data_sources import get_short_fiber_composites_data_sources

ImportError: cannot import name 'get_short_fiber_composites_data_sources' from 'ansys.dpf.composites.data_sources' (C:\pyansysvenv\lib\site-packages\ansys\dpf\composites\data_sources.py)

📝 Steps to reproduce

Direct download and run of code for both spyder and jupyterlab yields the error above.

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

2021R2

🐍 Which Python version are you using?

3.10

📦 Installed packages

I see a version issue between pyansys and ansys-dpf-core where i have upgraded dpf-core

(pyansysvenv) C:\Users\104121>python -m pip freeze
alabaster==0.7.13
ansys-api-fluent==0.3.12
ansys-api-mapdl==0.5.1
ansys-api-mechanical==0.1.0
ansys-api-meshing-prime==0.1.1
ansys-api-platform-instancemanagement==1.0.0
ansys-api-pyensight==0.3.0
ansys-api-sherlock==0.1.14
ansys-api-systemcoupling==0.1.0
ansys-dpf-composites==0.2.0
ansys-dpf-core==0.10.0
ansys-dpf-gate==0.3.1
ansys-dpf-gatebin==0.4.1
ansys-dpf-post==0.4.0
ansys-dynamicreporting-core==0.4.0
ansys-fluent-core==0.14.0
ansys-grantami-bomanalytics==1.1.3
ansys-grantami-bomanalytics-openapi==1.0.0
ansys-grantami-recordlists==1.0.0
ansys-grantami-serverapi-openapi==1.0.0
ansys-grpc-dpf==0.8.1
ansys-mapdl-core==0.64.1
ansys-mapdl-reader==0.52.20
ansys-math-core==0.1.1
ansys-mechanical-core==0.8.0
ansys-meshing-prime==0.4.1
ansys-motorcad-core==0.1.3
ansys-openapi-common==1.2.1
ansys-optislang-core==0.2.1
ansys-platform-instancemanagement==1.1.1
ansys-pyensight-core==0.5.3
ansys-pythonnet==3.1.0rc1
ansys-seascape==0.2.0
ansys-sherlock-core==0.2.0
ansys-systemcoupling-core==0.1.3
appdirs==1.4.4
arrow==1.3.0
asgiref==3.7.2
astroid==2.15.8
asttokens==2.4.1
atomicwrites==1.4.1
attrs==23.1.0
autopep8==2.0.4
Babel==2.13.1
bcrypt==4.0.1
beautifulsoup4==4.12.2
binaryornot==0.4.4
black==23.10.1
bleach==6.1.0
build==1.0.3
cachetools==5.3.2
certifi==2023.7.22
cffi==1.16.0
chardet==5.2.0
charset-normalizer==3.3.2
click==8.1.7
cloudpickle==3.0.0
clr-loader==0.2.6
colorama==0.4.6
comm==0.2.0
contourpy==1.2.0
cookiecutter==2.4.0
cryptography==41.0.5
cycler==0.12.1
debugpy==1.8.0
decorator==5.1.1
defusedxml==0.7.1
diff-match-patch==20230430
dill==0.3.7
Django==4.2.7
docstring-to-markdown==0.13
docutils==0.20.1
exceptiongroup==1.1.3
executing==2.0.1
fastjsonschema==2.18.1
filelock==3.13.1
flake8==6.0.0
fonttools==4.44.0
google-api-core==2.12.0
google-api-python-client==2.106.0
google-auth==2.23.4
google-auth-httplib2==0.1.1
googleapis-common-protos==1.61.0
grpcio==1.59.2
grpcio-status==1.48.2
h5py==3.10.0
httplib2==0.22.0
idna==3.4
imagesize==1.4.1
importlib-metadata==6.8.0
inflection==0.5.1
intervaltree==3.1.0
ipykernel==6.26.0
ipython==8.17.2
ipython-genutils==0.2.0
isort==5.12.0
jaraco.classes==3.3.0
jedi==0.18.2
jellyfish==1.0.1
Jinja2==3.1.2
jsonschema==4.19.2
jsonschema-specifications==2023.7.1
jupyter_client==8.6.0
jupyter_core==5.5.0
jupyterlab-pygments==0.2.2
keyring==24.2.0
kiwisolver==1.4.5
lazy-object-proxy==1.9.0
lxml==4.9.3
markdown-it-py==3.0.0
MarkupSafe==2.1.3
matplotlib==3.8.1
matplotlib-inline==0.1.6
mccabe==0.7.0
mdurl==0.1.2
mistune==3.0.2
more-itertools==10.1.0
mypy-extensions==1.0.0
nbclient==0.8.0
nbconvert==7.11.0
nbformat==5.9.2
nest-asyncio==1.5.8
nh3==0.2.14
numpy==1.26.1
numpydoc==1.6.0
packaging==23.2
pandas==2.1.2
pandocfilters==1.5.0
paramiko==3.3.1
parso==0.8.3
pathspec==0.11.2
pexpect==4.8.0
pickleshare==0.7.5
Pillow==10.1.0
pkginfo==1.9.6
platformdirs==3.11.0
pluggy==1.3.0
plumbum==1.8.2
pooch==1.8.0
prompt-toolkit==3.0.39
protobuf==3.20.3
psutil==5.9.6
ptyprocess==0.7.0
pure-eval==0.2.2
pyaedt==0.6.76
pyansys==2023.2.11
pyansys-docker==5.0.4
pyansys-tools-versioning==0.5.0
pyasn1==0.5.0
pyasn1-modules==0.3.0
pycodestyle==2.10.0
pycparser==2.21
pydocstyle==6.3.0
pyflakes==3.0.1
Pygments==2.16.1
pyiges==0.3.1
pylint==2.17.7
pylint-venv==3.0.3
pyls-spyder==0.4.0
PyNaCl==1.5.0
pyparsing==3.1.1
pypiwin32==223
pypng==0.20220715.0
pyproject_hooks==1.0.0
PyQt5==5.15.10
PyQt5-Qt5==5.15.2
PyQt5-sip==12.13.0
PyQtWebEngine==5.15.6
PyQtWebEngine-Qt5==5.15.2
pyspnego==0.10.2
python-dateutil==2.8.2
python-lsp-black==1.3.0
python-lsp-jsonrpc==1.1.2
python-lsp-server==1.7.4
python-slugify==8.0.1
pythonnet==3.0.1
pytoolconfig==1.2.6
pytwin==0.3.0
pytz==2023.3.post1
pyvista==0.42.3
pywin32==306
pywin32-ctypes==0.2.2
PyYAML==6.0.1
pyzmq==25.1.1
QDarkStyle==3.1
qstylizer==0.2.2
QtAwesome==1.2.3
qtconsole==5.4.4
QtPy==2.4.1
readme-renderer==42.0
referencing==0.30.2
requests==2.31.0
requests-negotiate-sspi==0.5.2
requests-ntlm==1.2.0
requests-toolbelt==1.0.0
rfc3986==2.0.0
rich==13.6.0
rope==1.11.0
rpds-py==0.12.0
rpyc==5.3.1
rsa==4.9
Rtree==1.1.0
scipy==1.11.3
scooby==0.9.2
six==1.16.0
snowballstemmer==2.2.0
sortedcontainers==2.4.0
soupsieve==2.5
Sphinx==7.2.6
sphinxcontrib-applehelp==1.0.7
sphinxcontrib-devhelp==1.0.5
sphinxcontrib-htmlhelp==2.0.4
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.6
sphinxcontrib-serializinghtml==1.1.9
spyder==5.4.5
spyder-kernels==2.4.4
sqlparse==0.4.4
sspilib==0.1.0
stack-data==0.6.3
tabulate==0.9.0
text-unidecode==1.3
textdistance==4.6.0
three-merge==0.1.1
tinycss2==1.2.1
tomli==2.0.1
tomlkit==0.12.2
tornado==6.3.3
tqdm==4.66.1
traitlets==5.13.0
twine==4.0.2
types-python-dateutil==2.8.19.14
typing==3.7.4.3
typing_extensions==4.8.0
tzdata==2023.3
ujson==5.8.0
uritemplate==4.1.1
urllib3==1.26.18
vtk==9.2.6
watchdog==3.0.0
wcwidth==0.2.9
webencodings==0.5.1
websocket-client==1.6.4
whatthepatch==1.0.5
wrapt==1.15.0
yapf==0.40.2
zipp==3.17.0
@MNymannG MNymannG added the bug Something isn't working label Nov 13, 2023
@greschd
Copy link
Member

greschd commented Nov 13, 2023

Hi @MNymannG 👋

Thanks for reporting this issue.

From the "Installed packages" list, it seems you're using version 0.2.0 of ansys-dpf-composites [1], whereas the downloaded example probably refers to 0.3.2. You can find the example corresponding to 0.2.0 here: https://composites.dpf.docs.pyansys.com/version/0.2/examples/gallery_examples/3_short_fiber_example.html#sphx-glr-examples-gallery-examples-3-short-fiber-example-py

You can choose which version the documentation refers to using a drop-down in the top-right corner of the page:
image

Another issue you may encounter is that the 2021R2 Ansys version does not support PyDPF Composites. You can find a list of compatible versions on this page.

[1] The 0.2.0 version is part of the currently latest pyansys meta-package release 2023.2.11.

@MNymannG
Copy link
Author

MNymannG commented Nov 14, 2023 via email

@greschd
Copy link
Member

greschd commented Nov 14, 2023

Do you know if there is a way to select the ansys version if you have multiple installed?

Yes, you can pass the ansys_path parameter to the connect_to_or_start_server function. So, for example

server = connect_to_or_start_server(ansys_path="C:\\Program Files\\ANSYS Inc\\v232")

Alternatively, if you are running DPF in a Docker container (docs), this function accepts the IP and port for the server. For example:

server = connect_to_or_start_server(ip="127.0.0.1", port=50052)

The corresponding documentation can be found here: https://composites.dpf.docs.pyansys.com/version/0.2/api/_autosummary/ansys.dpf.composites.server_helpers.connect_to_or_start_server.html#connect-to-or-start-server

@MNymannG
Copy link
Author

MNymannG commented Nov 14, 2023 via email

@MNymannG
Copy link
Author

MNymannG commented Nov 14, 2023 via email

@greschd
Copy link
Member

greschd commented Nov 14, 2023

Hi Mads,

It seems since you replied via e-mail, GitHub treated some of the error message as e-mail addresses and removed them. I can only see ***@***.***.

Would you mind posting the errors directly on Github, or editing the comments above?

Thank you,
Dominik

@MNymannG
Copy link
Author

MNymannG commented Nov 15, 2023 via email

@janvonrickenbach
Copy link
Contributor

@FedericoNegri Do you have any more documentation on the short fiber workflow in dpf, especially on the fatigue operators?

@MNymannG
Copy link
Author

MNymannG commented Nov 21, 2023 via email

@janvonrickenbach
Copy link
Contributor

Hi @MNymannG,

I forwarded your request, you should be contacted soon by your channel partner.

@MNymannG
Copy link
Author

MNymannG commented Nov 22, 2023 via email

@MNymannG
Copy link
Author

MNymannG commented Jan 8, 2024 via email

@janvonrickenbach
Copy link
Contributor

Hi @MNymannG,

Sorry for the delay. I forwarded your request in November, but apperently nothing happened. I forwarded your request again, please let me know if you don't hear anything within a week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants