From fb8ec0094949d529c4e996b52bc1842552d72ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nico=20Schl=C3=B6mer?= Date: Sat, 22 Jan 2022 15:02:00 +0100 Subject: [PATCH] convert fix --- README.md | 2 +- src/meshio/_cli/_convert.py | 8 ++++++-- tests/test_cli.py | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f70dd02bd..097456527 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ -[![Discord](https://img.shields.io/static/v1?logo=discord&label=chat&message=on%20discord&color=7289da&style=flat-square)](https://discord.gg/Z6DMsJh4Hr) +[![Discord](https://img.shields.io/static/v1?logo=discord&logoColor=white&label=chat&message=on%20discord&color=7289da&style=flat-square)](https://discord.gg/Z6DMsJh4Hr) [![gh-actions](https://img.shields.io/github/workflow/status/nschloe/meshio/ci?style=flat-square)](https://github.com/nschloe/meshio/actions?query=workflow%3Aci) [![codecov](https://img.shields.io/codecov/c/github/nschloe/meshio.svg?style=flat-square)](https://app.codecov.io/gh/nschloe/meshio) diff --git a/src/meshio/_cli/_convert.py b/src/meshio/_cli/_convert.py index ce19f2e22..1a2edd307 100644 --- a/src/meshio/_cli/_convert.py +++ b/src/meshio/_cli/_convert.py @@ -56,10 +56,14 @@ def convert(args): mesh.points = np.ascontiguousarray(mesh.points) if args.sets_to_int_data: - mesh.sets_to_int_data() + mesh.point_sets_to_data() + mesh.cell_sets_to_data() if args.int_data_to_sets: - mesh.int_data_to_sets() + for key in mesh.point_data: + mesh.point_data_to_sets(key) + for key in mesh.cell_data: + mesh.cell_data_to_sets(key) # write it out kwargs = {"file_format": args.output_format} diff --git a/tests/test_cli.py b/tests/test_cli.py index 165062e0c..8ae535477 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -36,6 +36,7 @@ def test_convert(tmp_path): "gmsh", "--output-format", "vtk", + "--sets-to-int-data", ] )