mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Apply suggestions from code review
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
37331deeee
commit
afa490f6a6
2 changed files with 5 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue