From 30bd29e71f5428f872fba50c11d7cac0c5768be7 Mon Sep 17 00:00:00 2001 From: Shiyu Du <115027341+Shiyu-Sandy-Du@users.noreply.github.com> Date: Tue, 19 Dec 2023 14:21:23 +0100 Subject: [PATCH 1/2] Update dataset.py open_dataset can only get coordinates in single precision. Here in this change, the coordinates can be extracted in double precision --- pymech/dataset.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pymech/dataset.py b/pymech/dataset.py index b681dba..14e3b26 100644 --- a/pymech/dataset.py +++ b/pymech/dataset.py @@ -136,7 +136,9 @@ def meshgrid_to_dim(self, mesh): coordinates from a cubical array format for every direction """ - dim = np.unique(np.round(mesh, 8)) + u, indices = np.unique(np.round(mesh,8), return_index=True) + mesh_1d = np.reshape(mesh,np.size(mesh)) + dim = mesh_1d[indices] return dim def get_dimensions(self): From 8d58cb618342adc9a5e6883255e1b5ba992212db Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 19 Dec 2023 13:25:33 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pymech/dataset.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pymech/dataset.py b/pymech/dataset.py index 14e3b26..70cc958 100644 --- a/pymech/dataset.py +++ b/pymech/dataset.py @@ -136,8 +136,8 @@ def meshgrid_to_dim(self, mesh): coordinates from a cubical array format for every direction """ - u, indices = np.unique(np.round(mesh,8), return_index=True) - mesh_1d = np.reshape(mesh,np.size(mesh)) + u, indices = np.unique(np.round(mesh, 8), return_index=True) + mesh_1d = np.reshape(mesh, np.size(mesh)) dim = mesh_1d[indices] return dim