[skip ci] language polishing

This commit is contained in:
Philip Eisenlohr 2021-04-24 13:12:44 -04:00
parent 24046ef683
commit 690b478013
4 changed files with 22 additions and 22 deletions

View File

@ -59,17 +59,17 @@ class Result:
""" """
Add data to and export data from a DADF5 file. Add data to and export data from a DADF5 file.
A DADF5 (DAMASK HDF5) file contain DAMASK results. A DADF5 (DAMASK HDF5) file contains DAMASK results.
Its group/folder structure reflects the layout in material.yaml. Its group/folder structure reflects the layout in material.yaml.
This class provides a customable view on the DADF5 file. This class provides a customizable view on the DADF5 file.
Upon initialization, all attributes are visible. Upon initialization, all attributes are visible.
Derived quantities are added to the file and existing data is Derived quantities are added to the file and existing data is
exported based on the current view. exported based on the current view.
Examples Examples
-------- --------
Open 'my_file.hdf5', which needs to contain deformation gradient 'F' Open 'my_file.hdf5', which is assumed to contain deformation gradient 'F'
and first Piola-Kirchhoff stress 'P', add the Mises equivalent of the and first Piola-Kirchhoff stress 'P', add the Mises equivalent of the
Cauchy stress, and export it to VTK (file) and numpy.ndarray (memory). Cauchy stress, and export it to VTK (file) and numpy.ndarray (memory).
@ -234,12 +234,12 @@ class Result:
def modification_enable(self): def modification_enable(self):
""" """
Allow to modify existing data. Allow modification of existing data.
Returns Returns
------- -------
modified_view : damask.Result modified_view : damask.Result
View where data is not write-protected. View without write-protection of existing data.
""" """
print(util.warn('Warning: Modification of existing datasets allowed!')) print(util.warn('Warning: Modification of existing datasets allowed!'))
@ -249,12 +249,12 @@ class Result:
def modification_disable(self): def modification_disable(self):
""" """
Disallow to modify existing data (default case). Prevent modification of existing data (default case).
Returns Returns
------- -------
modified_view : damask.Result modified_view : damask.Result
View where data is write-protected. View with write-protection of existing data.
""" """
dup = self.copy() dup = self.copy()
@ -328,7 +328,7 @@ class Result:
Returns Returns
------- -------
view : damask.Result view : damask.Result
View with where selected attributes are visible. View with only the selected attributes being visible.
Examples Examples
-------- --------
@ -338,7 +338,7 @@ class Result:
>>> r = damask.Result('my_file.hdf5') >>> r = damask.Result('my_file.hdf5')
>>> r_first = r.view('increment',0) >>> r_first = r.view('increment',0)
Get a view that shows all results of in simulation time [10,40]: Get a view that shows all results between simulation times of 10 to 40:
>>> import damask >>> import damask
>>> r = damask.Result('my_file.hdf5') >>> r = damask.Result('my_file.hdf5')
@ -363,7 +363,7 @@ class Result:
Returns Returns
------- -------
modified_view : damask.Result modified_view : damask.Result
View with more visible attributes. View with additional visible attributes.
Examples Examples
-------- --------
@ -380,7 +380,7 @@ class Result:
def view_less(self,what,datasets): def view_less(self,what,datasets):
""" """
Delete from view. Remove from view.
Parameters Parameters
---------- ----------
@ -393,11 +393,11 @@ class Result:
Returns Returns
------- -------
modified_view : damask.Result modified_view : damask.Result
View with less visible attributes. View with fewer visible attributes.
Examples Examples
-------- --------
Get a view that does not show the undeformed configuration: Get a view that omits the undeformed configuration:
>>> import damask >>> import damask
>>> r_all = damask.Result('my_file.hdf5') >>> r_all = damask.Result('my_file.hdf5')
@ -1396,7 +1396,7 @@ class Result:
Parameters Parameters
---------- ----------
output : (list of) str, optional output : (list of) str, optional
Names of the datasets included in the VTK file. Names of the datasets to export to the VTK file.
Defaults to '*', in which case all datasets are exported. Defaults to '*', in which case all datasets are exported.
mode : {'cell', 'point'} mode : {'cell', 'point'}
Export in cell format or point format. Export in cell format or point format.
@ -1521,7 +1521,7 @@ class Result:
in the DADF5 file. in the DADF5 file.
Multi-phase data is fused into a single output. Multi-phase data is fused into a single output.
`place` is equivalent to `read` if only one phase/homogenization `place` is equivalent to `get` if only one phase/homogenization
and one constituent is present. and one constituent is present.
Parameters Parameters
@ -1537,7 +1537,7 @@ class Result:
Remove branches with no data. Defaults to True. Remove branches with no data. Defaults to True.
constituents : (list of) int, optional constituents : (list of) int, optional
Constituents to consider. Constituents to consider.
Defaults to 'None', in which case all constituents are considered. Defaults to None, in which case all constituents are considered.
fill_float : float fill_float : float
Fill value for non-existent entries of floating point type. Fill value for non-existent entries of floating point type.
Defaults to NaN. Defaults to NaN.

View File

@ -46,9 +46,9 @@ class VTK:
grid : iterable of int, len (3) grid : iterable of int, len (3)
Number of cells along each dimension. Number of cells along each dimension.
size : iterable of float, len (3) size : iterable of float, len (3)
Physical lengths along each dimension. Physical length along each dimension.
origin : iterable of float, len (3), optional origin : iterable of float, len (3), optional
Spatial origin coordinates. Coordinates of grid origin.
Returns Returns
------- -------
@ -161,7 +161,7 @@ class VTK:
""" """
if not os.path.isfile(fname): # vtk has a strange error handling if not os.path.isfile(fname): # vtk has a strange error handling
raise FileNotFoundError(f'no such file: {fname}') raise FileNotFoundError(f'No such file: {fname}')
ext = Path(fname).suffix ext = Path(fname).suffix
if ext == '.vtk' or dataset_type is not None: if ext == '.vtk' or dataset_type is not None:
reader = vtk.vtkGenericDataObjectReader() reader = vtk.vtkGenericDataObjectReader()

View File

@ -493,7 +493,7 @@ def node_to_point(node_data):
def coordinates0_valid(coordinates0): def coordinates0_valid(coordinates0):
""" """
Check whether coordinates lie on a regular grid. Check whether coordinates form a regular grid.
Parameters Parameters
---------- ----------
@ -503,7 +503,7 @@ def coordinates0_valid(coordinates0):
Returns Returns
------- -------
valid : bool valid : bool
Wheter the coordinates lie on a regular grid. Whether the coordinates form a regular grid.
""" """
try: try:

View File

@ -1,3 +1,3 @@
"""Run simulations directly from python.""" """Run simulations directly from Python."""
from ._marc import Marc # noqa from ._marc import Marc # noqa