copy not needed
YAML writer does not write out references anymore
This commit is contained in:
parent
35ca1ffb0a
commit
9a278daa3f
|
@ -1,5 +1,3 @@
|
||||||
import copy
|
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
from . import Config
|
from . import Config
|
||||||
|
@ -289,7 +287,7 @@ class ConfigMaterial(Config):
|
||||||
c = [{} for _ in range(length)] if constituents is None else \
|
c = [{} for _ in range(length)] if constituents is None else \
|
||||||
[{'constituents':u} for u in ConfigMaterial._constituents(**constituents)]
|
[{'constituents':u} for u in ConfigMaterial._constituents(**constituents)]
|
||||||
|
|
||||||
if len(c) == 1: c = [copy.deepcopy(c[0]) for _ in range(length)]
|
if len(c) == 1: c = [c[0] for _ in range(length)]
|
||||||
|
|
||||||
if length != 1 and length != len(c):
|
if length != 1 and length != len(c):
|
||||||
raise ValueError('Cannot add entries of different length')
|
raise ValueError('Cannot add entries of different length')
|
||||||
|
@ -301,7 +299,7 @@ class ConfigMaterial(Config):
|
||||||
else:
|
else:
|
||||||
for i in range(len(c)):
|
for i in range(len(c)):
|
||||||
c[i][k] = v
|
c[i][k] = v
|
||||||
dup = copy.deepcopy(self)
|
dup = self.copy()
|
||||||
dup['material'] = dup['material'] + c if 'material' in dup else c
|
dup['material'] = dup['material'] + c if 'material' in dup else c
|
||||||
|
|
||||||
return dup
|
return dup
|
||||||
|
|
Loading…
Reference in New Issue