Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cython._binary_reader: cells_with_*_nodes: Generalize and simplify by…
… directly using `offset` for next cell offset; close: `_file_out` does not exist; correct pyvista version check for version 0.32.dev0 (#74) * Result._plot_point_scalars: Use argument return_cpos in any case ... before, it was used only, when `if animate`. Now, it used in any case of the call `plotter.show`. * Result._plot_point_scalars: fix screenshot function on Windows OS pyvista\plotting\plotting.py:4882: On Windows OS "in the event that the user hits the exit-button on the GUI then it must be finalized and deleted as accessing it will kill the kernel... proper screenshots cannot be saved if this happens" Therefore, when you used ´_plot_point_scalars(..., screenshot=...)´, you got at ansys\mapdl\reader\rst.py:2830: ´RuntimeError: This plotter is closed and unable to save a screenshot.´ The only solution is, to pass the ´screenshot´ argument to ´plotter.show´ as done in this patch. * Result._plot_point_scalars: future-safe pyvista version check ... the old version would break with version 1.0.0. I used the same compare operation as in <https://github.com/rbarrois/python-semanticversion/blob/master/semantic_version/base.py> tested manually. * cython._binary_reader.cells_with_*_nodes: Generalize and simplify by directly using `offset` for next cell offset - Therefore the function `cell_lookup`, which was limited to 3D cells, is no longer necessary. - Now, all cell types are supported, while the functions has even been simplified. - Now, the functions do not need the parameter `celltypes` any more. Since they are only used in rst.py in the private method `Result._extract_node_components`, I took the liberty to remove the parameter A in the respective definition und the respective call. Remark: Only tested with a pure python version of the functions, please test the cython function of the commit! * cython._binary_reader.cells_with_*_nodes: correct expression for `ncells` * _binary.reader: _file_out does not exist When you called `AnsysFile.close()` you got at line 255 'ansys.mapdl.reader._binary_reader.AnsysFile' object has no attribute '_file_out' as `_file_out` is never created (this line is the only occurrence). * Result._plot_point_scalars: correct pyvista version check for version 0.32.dev0 The actual development version is 0.32.dev0: `pv._version.version_info = (0, 32, "dev0")`. There, the string `"dev0"` can not be compared with `0`, so that comparison failed for this version. To solve this, I removed the last element on the right-hand side expression of the comparison. The new comparison `(0, 32, "dev0") > (0, 32)` works now as expected. Tested manually.
- Loading branch information