From 5603e328b8650e874b2cf0235bba6fe792850129 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Wed, 29 Jun 2022 13:24:44 +0200 Subject: [PATCH] docstrings --- openmc/mesh.py | 48 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/openmc/mesh.py b/openmc/mesh.py index db2e1593c5..1372c5196e 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -626,8 +626,16 @@ class RegularMesh(StructuredMesh): """Creates a VTK object of the mesh Args: - filename (str, optional): Name of the vtk file to write = - (must end with .vtk). Defaults to None. + filename (str): Name of the VTK file to write. + datasets (dict): Dictionary whose keys are the data labels + and values are the data sets. + volume_normalization (bool, optional): Whether or not to + normalize the data by the volume of the mesh elements. + Defaults to True. + + Raises: + RuntimeError: when no volume data is found and volume_normalisation + is required Returns: vtk.vtkStructuredGrid: the VTK object @@ -899,8 +907,16 @@ class RectilinearMesh(StructuredMesh): """Creates a VTK object of the mesh Args: - filename (str, optional): Name of the vtk file to write = - (must end with .vtk). Defaults to None. + filename (str): Name of the VTK file to write. + datasets (dict): Dictionary whose keys are the data labels + and values are the data sets. + volume_normalization (bool, optional): Whether or not to + normalize the data by the volume of the mesh elements. + Defaults to True. + + Raises: + RuntimeError: when no volume data is found and volume_normalisation + is required Returns: vtk.vtkStructuredGrid: the VTK object @@ -1153,8 +1169,16 @@ class CylindricalMesh(StructuredMesh): """Creates a VTK object of the mesh Args: - filename (str, optional): Name of the vtk file to write = - (must end with .vtk). Defaults to None. + filename (str): Name of the VTK file to write. + datasets (dict): Dictionary whose keys are the data labels + and values are the data sets. + volume_normalization (bool, optional): Whether or not to + normalize the data by the volume of the mesh elements. + Defaults to True. + + Raises: + RuntimeError: when no volume data is found and volume_normalisation + is required Returns: vtk.vtkStructuredGrid: the VTK object @@ -1409,8 +1433,16 @@ class SphericalMesh(StructuredMesh): """Creates a VTK object of the mesh Args: - filename (str, optional): Name of the vtk file to write = - (must end with .vtk). Defaults to None. + filename (str): Name of the VTK file to write. + datasets (dict): Dictionary whose keys are the data labels + and values are the data sets. + volume_normalization (bool, optional): Whether or not to + normalize the data by the volume of the mesh elements. + Defaults to True. + + Raises: + RuntimeError: when no volume data is found and volume_normalisation + is required Returns: vtk.vtkStructuredGrid: the VTK object