From 12cd19554f6599147b756aaceadfdf6cffa8a551 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 13 May 2022 06:02:22 +0200 Subject: [PATCH 1/4] consistent interface and description --- python/damask/_table.py | 4 ++-- python/damask/_vtk.py | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/python/damask/_table.py b/python/damask/_table.py index f440b7302..2d2c30c00 100644 --- a/python/damask/_table.py +++ b/python/damask/_table.py @@ -370,9 +370,9 @@ class Table: label : str Column label. data : numpy.ndarray - Column data. + Column data. First dimension needs to match number of rows. info : str, optional - Human-readable information about the modified data. + Human-readable information about the data. Returns ------- diff --git a/python/damask/_vtk.py b/python/damask/_vtk.py index 880b00ede..aa0be4dea 100644 --- a/python/damask/_vtk.py +++ b/python/damask/_vtk.py @@ -404,10 +404,11 @@ class VTK: def set(self, label: str = None, data: Union[np.ndarray, np.ma.MaskedArray] = None, + info: str = None, *, table: 'Table' = None): """ - Add (or replace existing) point or cell data. + Add new or replace existing point or cell data. Data can either be a numpy.array, which requires a corresponding label, or a damask.Table. @@ -419,6 +420,8 @@ class VTK: data : numpy.ndarray or numpy.ma.MaskedArray, optional Data to add or replace. First array dimension needs to match either number of cells or number of points. + info : str, optional + Human-readable information about the data. table: damask.Table, optional Data to add or replace. Each table label is individually considered. Number of rows needs to match either number of cells or number of points. @@ -465,14 +468,17 @@ class VTK: _add_array(dup.vtk_data, label, np.where(data.mask,data.fill_value,data) if isinstance(data,np.ma.MaskedArray) else data) + if info is not None: dup.comments = f'{label}: {info}' else: raise ValueError('no label defined for data') elif isinstance(table,Table): for l in table.labels: _add_array(dup.vtk_data,l,table.get(l)) + if info is not None: dup.comments = f'{l}: {info}' else: raise TypeError + return dup From 8442f0cdd3cdeb4ebeac1809a9db6941d9cf9dd6 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 17 May 2022 16:12:00 -0400 Subject: [PATCH 2/4] accumulate comments --- python/damask/_vtk.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/damask/_vtk.py b/python/damask/_vtk.py index aa0be4dea..6baa16214 100644 --- a/python/damask/_vtk.py +++ b/python/damask/_vtk.py @@ -468,13 +468,13 @@ class VTK: _add_array(dup.vtk_data, label, np.where(data.mask,data.fill_value,data) if isinstance(data,np.ma.MaskedArray) else data) - if info is not None: dup.comments = f'{label}: {info}' + if info is not None: dup.comments += f'{label}: {info}' else: raise ValueError('no label defined for data') elif isinstance(table,Table): for l in table.labels: _add_array(dup.vtk_data,l,table.get(l)) - if info is not None: dup.comments = f'{l}: {info}' + if info is not None: dup.comments += f'{l}: {info}' else: raise TypeError From 0962d2ebdf292bdef271dc2573099fe2226741c4 Mon Sep 17 00:00:00 2001 From: Test User Date: Wed, 18 May 2022 03:17:26 +0200 Subject: [PATCH 3/4] [skip ci] updated version information after successful test of v3.0.0-alpha6-371-g18d862cdb --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 73aee9b3f..435d3544f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0-alpha6-367-g85fa92ee1 +3.0.0-alpha6-371-g18d862cdb From 41a732f62df0ab2e3538156801b405f35a8f3244 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 19 May 2022 16:36:50 +0200 Subject: [PATCH 4/4] assumed rank solution gives wrong results #194 --- src/HDF5_utilities.f90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/HDF5_utilities.f90 b/src/HDF5_utilities.f90 index 86807507b..fcd2c189a 100644 --- a/src/HDF5_utilities.f90 +++ b/src/HDF5_utilities.f90 @@ -48,7 +48,7 @@ module HDF5_utilities !> @details for parallel IO, all dimension except for the last need to match !-------------------------------------------------------------------------------------------------- interface HDF5_write -#if defined(__GFORTRAN__) && __GNUC__<11 +#if defined(__GFORTRAN__) module procedure HDF5_write_real1 module procedure HDF5_write_real2 module procedure HDF5_write_real3 @@ -1214,7 +1214,7 @@ subroutine HDF5_read_int7(dataset,loc_id,datasetName,parallel) end subroutine HDF5_read_int7 -#if defined(__GFORTRAN__) && __GNUC__<11 +#if defined(__GFORTRAN__) !-------------------------------------------------------------------------------------------------- !> @brief write dataset of type real with 1 dimension @@ -1631,7 +1631,7 @@ subroutine HDF5_write_str(dataset,loc_id,datasetName) end subroutine HDF5_write_str -#if defined(__GFORTRAN__) && __GNUC__<11 +#if defined(__GFORTRAN__) !-------------------------------------------------------------------------------------------------- !> @brief write dataset of type integer with 1 dimension