Apply suggestions from code review

Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
Josh May 2023-01-11 13:27:06 -08:00 committed by GitHub
parent 37331deeee
commit afa490f6a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View file

@ -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

View file

@ -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