-
Notifications
You must be signed in to change notification settings - Fork 1
Short fiber example: fiber orientation tensor #233
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
Conversation
@janvonrickenbach @greschd I downloaded the html doc artifact and was surprised to see that the Axx and Ayy plot have inverted titles! |
@PProfizi: We get strange results when plotting results on the same mesh. To me this looks related to ansys/pydpf-core#632. |
Hi @janvonrickenbach, looking at the scalar bars between your "expected" and the "current", not only are the titles inverted but the maximum and minimum are not the same. I will take a look but I need to know how you got your "expected" reference. Is that with DPF-Core 0.7.4 or is that when run locally vs generated by Sphinx? |
@PProfizi Reference results were obtained by running the notebook locally step-wise in a venv with DPF-Core 0.7.4. |
Another way I managed to produce the wrong results is by creating three different meshes to plot on (while keeping the rest the same). Still running the script locally: I'm not sure if this is supposed to work, but it might be an easier way to get to the root cause since it takes Sphinx out of the equation. @@ -50,6 +50,12 @@ data_sources.set_result_file_path(composite_files_on_server.rst)
model = dpf.Model(data_sources=data_sources)
mesh = model.metadata.meshed_region
+model2 = dpf.Model(data_sources=data_sources)
+mesh2 = model2.metadata.meshed_region
+
+model3 = dpf.Model(data_sources=data_sources)
+mesh3 = model3.metadata.meshed_region
+
# %%
# Plot input data
# ~~~~~~~~~~~~~~~
@@ -112,6 +118,16 @@ aXX = fiber_orientation_tensor_fc.select_component(0)[0]
aYY = fiber_orientation_tensor_fc.select_component(1)[0]
aXZ = fiber_orientation_tensor_fc.select_component(5)[0]
+# %%
+# Plot Axx
mesh.plot(aXX, title="Axx", text="Axx plot")
-mesh.plot(aYY, title="Ayy", text="Ayy plot")
-mesh.plot(aXZ, title="Axz", text="Axz plot")
+
+
+# %%
+# Plot Ayy
+mesh2.plot(aYY, title="Ayy", text="Ayy plot")
+
+
+# %%
+# Plot Axz
+mesh3.plot(aXZ, title="Axz", text="Axz plot") |
Hi @greschd @FedericoNegri, I did not manage to reproduce the issue when running
Is there something I am missing? PS: I have added a while ago this step right before all of our PyDPF testing or documentation jobs. It has proved to make debugging a lot easier. |
@PProfizi I realized the difference is not due to the three different meshes, but due to running via the The unified install gives the correct output, whereas the Docker container does not. I'm not sure if this means it's a Linux-only issue, or if something is wrong only in the Docker container. I'll test a unified install on Linux to compare. Debug instructions:
|
The difference seems to be independent of plotting. I've modified the example to just print a result, and run with both a local and container server here. Output on Windows:
|
@PProfizi FYI, we figured out the root cause for these issues. In the example, we're accessing some data by index instead of by label, and the order in which the arrays are added is not deterministic. No further action needed from your side, thanks for your help. |
…to fnegri/sfw_ex_fot Update poetry lockfile
@FedericoNegri please review the changes made to the example. The main change is using the field variable name to correctly identify them (since the index is non-deterministic). |
…to fnegri/sfw_ex_fot Update poetry lockfile.
* Bump ansys-sphinx-theme from 0.9.5 to 0.9.6 (#240) Bumps [ansys-sphinx-theme](https://github.com/ansys/ansys-sphinx-theme) from 0.9.5 to 0.9.6. - [Release notes](https://github.com/ansys/ansys-sphinx-theme/releases) - [Commits](ansys/ansys-sphinx-theme@v0.9.5...v0.9.6) --- updated-dependencies: - dependency-name: ansys-sphinx-theme dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Remove the poetry workaround for sphinx theme installation (#241) * Update dpf core version (#243) * Bump peter-evans/create-or-update-comment from 2 to 3 (#249) Bumps [peter-evans/create-or-update-comment](https://github.com/peter-evans/create-or-update-comment) from 2 to 3. - [Release notes](https://github.com/peter-evans/create-or-update-comment/releases) - [Commits](peter-evans/create-or-update-comment@v2...v3) --- updated-dependencies: - dependency-name: peter-evans/create-or-update-comment dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump pytest from 7.2.2 to 7.3.0 (#250) Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.2.2 to 7.3.0. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](pytest-dev/pytest@7.2.2...7.3.0) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Short fiber example: fiber orientation tensor (#233) * Bump ansys-dpf-core from 0.8.0 to 0.8.1 (#253) Bumps [ansys-dpf-core](https://github.com/pyansys/pydpf-core) from 0.8.0 to 0.8.1. - [Release notes](https://github.com/pyansys/pydpf-core/releases) - [Commits](ansys/pydpf-core@v0.8.0...v0.8.1) --- updated-dependencies: - dependency-name: ansys-dpf-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump pytest from 7.3.0 to 7.3.1 (#254) Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.3.0 to 7.3.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](pytest-dev/pytest@7.3.0...7.3.1) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add info to explain switching of doc versions (#256) Update main index.rst file with minor edits Note: The display links to other topics should use the same title as the topic. This is a Google developer doc style guideline. Users can be confident that the have been taked to the correct place. * Drop support for Python 3.7 (#257) Drop support for Python 3.7, and remove it from the tox and CI/CD configurations. Upgrade mypy to avoid python/mypy#13499, and add checks for 'None' to account for newly reported errors. * Bump pre-commit from 2.21.0 to 3.2.2 (#259) Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.21.0 to 3.2.2. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](pre-commit/pre-commit@v2.21.0...v3.2.2) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update AWP_ROOT_DOCKER variable (#265) * Update pre-commit dependencies, remove code obsolete with Python 3.7 drop (#258) * Update pre-commit dependencies. * Add and run the `pyupgrade` pre-commit hook. * Remove `TYPE_CHECKING` guards for `numpy.typing`. * Set the minimum requirement for `numpy` to `1.22`. * Add 'build-wheelhouse' job to CI/CD (#264) * Add 'build-wheelhouse' job to CI/CD * Rename build-package to build-library, improve dependencies * Add allow-last-days option to package cleanup * Bump ansys-sphinx-theme from 0.9.7 to 0.9.8 (#266) Bumps [ansys-sphinx-theme](https://github.com/ansys/ansys-sphinx-theme) from 0.9.7 to 0.9.8. - [Release notes](https://github.com/ansys/ansys-sphinx-theme/releases) - [Commits](ansys/ansys-sphinx-theme@v0.9.7...v0.9.8) --- updated-dependencies: - dependency-name: ansys-sphinx-theme dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: janvonrickenbach <[email protected]> * Bump numpy from 1.22.0 to 1.24.3 (#267) Bumps [numpy](https://github.com/numpy/numpy) from 1.22.0 to 1.24.3. - [Release notes](https://github.com/numpy/numpy/releases) - [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst) - [Commits](numpy/numpy@v1.22.0...v1.24.3) --- updated-dependencies: - dependency-name: numpy dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: janvonrickenbach <[email protected]> * Bump pre-commit from 3.2.2 to 3.3.1 (#271) Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.2.2 to 3.3.1. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](pre-commit/pre-commit@v3.2.2...v3.3.1) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump ansys-sphinx-theme from 0.9.8 to 0.9.9 (#273) Bumps [ansys-sphinx-theme](https://github.com/ansys/ansys-sphinx-theme) from 0.9.8 to 0.9.9. - [Release notes](https://github.com/ansys/ansys-sphinx-theme/releases) - [Commits](ansys/ansys-sphinx-theme@v0.9.8...v0.9.9) --- updated-dependencies: - dependency-name: ansys-sphinx-theme dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Adapt to organization rename from 'pyansys' to 'ansys' (#276) Change the following references: - `github.com/pyansys` -> `github.com/ansys` - `ghcr.io/pyansys` -> `ghcr.io/ansys` - `pyansys/actions` -> `ansys/actions` - `https://codecov.io/gh/pyansys/pydpf-composites` -> `https://codecov.io/gh/ansys/pydpf-composites` * Adapt to change in Axes with maptlotlib==3.7.1 (#263) Bump matplotlib to ``3.7.1`` in ``poetry.lock``. The matplotlib 'Axes' class no longer inherits from 'SubplotBase' since matplotlib/matplotlib#23573. This breaks the '_get_subplot' method in 'sampling_point.py' which checks if the passed 'axes_obj' is a 'SubplotBase' instance to distinguish between indexable and non-indexable objects. To fix this, we now use a try-except block to index into the 'axes_obj', and catch the 'TypeError' that is raised if it is and 'Axes' (as opposed to an array). --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dominik Gresch <[email protected]> * Relax pyvista requirement upper bound (#278) Allow all pyvista versions `<1` to be used. This is required for compatibility with `ansys-fluent-visualization`, which depends on `>=0.39.0`. * Document docker container from customer portal (#277) * Support customer portal docker images and update docs * Remove --server-bin pytest option because it is not working anymore. * Ignore generated result definitions. * Update README.rst * Automatically upload file to server in CompositeModel * Add 2024_1_pre0 to supported directories. * Add show function to show sampling point plots --------- Co-authored-by: Dominik Gresch <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dominik Gresch <[email protected]> Co-authored-by: Federico Negri <[email protected]> Co-authored-by: Kathy Pippert <[email protected]> Co-authored-by: Dominik Gresch <[email protected]>
No description provided.