From 0d4227fa1f1baaee6116973a12072ba53ac6631f Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Tue, 7 Feb 2023 12:26:11 +0000 Subject: [PATCH 1/3] added volume information to material repr --- openmc/material.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openmc/material.py b/openmc/material.py index a213a53fd..28d38cb90 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -143,6 +143,9 @@ class Material(IDManagerMixin): string += '{: <16}=\t{}'.format('\tDensity', self._density) string += f' [{self._density_units}]\n' + string += '{: <16}=\t{}'.format('\tVolume', self._volume) + string += ' [cm3]\n' + string += '{: <16}\n'.format('\tS(a,b) Tables') if self._ncrystal_cfg: From 7becabcde4b2900ed134d1051a362411aca03dd2 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Thu, 23 Feb 2023 21:16:52 +0000 Subject: [PATCH 2/3] cm^3 instead of cm3 --- openmc/material.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openmc/material.py b/openmc/material.py index 28d38cb90..bdc25b280 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -144,7 +144,7 @@ class Material(IDManagerMixin): string += f' [{self._density_units}]\n' string += '{: <16}=\t{}'.format('\tVolume', self._volume) - string += ' [cm3]\n' + string += ' [cm^3]\n' string += '{: <16}\n'.format('\tS(a,b) Tables') From 0d84c538181022f607ddceb898c132faac2568b8 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Fri, 24 Feb 2023 22:05:00 +0000 Subject: [PATCH 3/3] review improvment, refactor to single line Co-authored-by: Paul Romano --- openmc/material.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openmc/material.py b/openmc/material.py index bdc25b280..a1b3367a9 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -143,8 +143,7 @@ class Material(IDManagerMixin): string += '{: <16}=\t{}'.format('\tDensity', self._density) string += f' [{self._density_units}]\n' - string += '{: <16}=\t{}'.format('\tVolume', self._volume) - string += ' [cm^3]\n' + string += '{: <16}=\t{} [cm^3]\n'.format('\tVolume', self._volume) string += '{: <16}\n'.format('\tS(a,b) Tables')