Skip to content

Commit 18322a7

Browse files
authored
Merge pull request #735 from nschloe/fix-get-cells-type-empty
Fix get cells type empty
2 parents 19359fd + 99be25c commit 18322a7

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ If you have downloaded a binary version of ParaView, you may proceed as follows.
148148
* Install meshio
149149
* Open ParaView
150150
* Find the file `paraview-meshio-plugin.py` of your meshio installation (on Linux:
151-
`~/.local/paraview-plugins/`) and load it under _Tools / Manage Plugins / Load New_
151+
`~/.local/share/paraview/plugins/`) and load it under _Tools / Manage Plugins / Load New_
152152
* _Optional:_ Activate _Auto Load_
153153

154154
You can now open all meshio-supported files in ParaView.

meshio/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "4.0.5"
1+
__version__ = "4.0.6"
22
__original_author__ = "Nico Schlömer"
33
__original_author_email__ = "[email protected]"
44
__copyright__ = "Copyright (c) 2015-2020 meshio developers"

meshio/_mesh.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ def write(self, path_or_buf, file_format=None, **kwargs):
121121
write(path_or_buf, self, file_format, **kwargs)
122122

123123
def get_cells_type(self, cell_type):
124+
if not any(c.type == cell_type for c in self.cells):
125+
return numpy.array([], dtype=int)
124126
return numpy.concatenate([c.data for c in self.cells if c.type == cell_type])
125127

126128
def get_cell_data(self, name, cell_type):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"Programming Language :: Python :: 3.8",
4949
"Topic :: Scientific/Engineering",
5050
],
51-
data_files=[("paraview-plugins", ["tools/paraview-meshio-plugin.py"])],
51+
data_files=[("share/paraview/plugins/", ["tools/paraview-meshio-plugin.py"])],
5252
entry_points={
5353
"console_scripts": [
5454
"meshio-ascii = meshio._cli:ascii",

0 commit comments

Comments
 (0)