From afa490f6a6c98e41062c180eb74fae20ddffdad4 Mon Sep 17 00:00:00 2001 From: Josh May Date: Wed, 11 Jan 2023 13:27:06 -0800 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Paul Romano --- openmc/cell.py | 3 +-- tests/unit_tests/test_cell.py | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/openmc/cell.py b/openmc/cell.py index cea362ed8f..a8e1178f41 100644 --- a/openmc/cell.py +++ b/openmc/cell.py @@ -518,8 +518,7 @@ class Cell(IDManagerMixin): paths = self._paths self._paths = None - clone = openmc.Cell() - clone.name = self.name + clone = openmc.Cell(name=self.name) clone.volume = self.volume if self.temperature is not None: clone.temperature = self.temperature diff --git a/tests/unit_tests/test_cell.py b/tests/unit_tests/test_cell.py index 4185e9a44c..cef77f1608 100644 --- a/tests/unit_tests/test_cell.py +++ b/tests/unit_tests/test_cell.py @@ -76,8 +76,8 @@ def test_clone(): # Add optional properties to the original cell to ensure they're cloned successfully c.temperature = 650. - c.translation = [1,2,3] - c.rotation = [4,5,6] + c.translation = (1., 2., 3.) + c.rotation = (4., 5., 6.) c.volume = 100 c5 = c.clone(clone_materials=False, clone_regions=False) @@ -92,8 +92,8 @@ def test_clone(): # Mutate the original to ensure the changes are not seen in the clones c.fill = openmc.Material() c.region = +openmc.ZCylinder() - c.translation = [-1,-2,-3] - c.rotation = [-4,-5,-6] + c.translation = (-1., -2., -3.) + c.rotation = (-4., -5., -6.) c.temperature = 1 c.volume = 1 assert c5.fill != c.fill