more logical layout

This commit is contained in:
Martin Diehl 2020-10-28 21:51:20 +01:00
parent 855bf124d3
commit 4ff99a7af4
1 changed files with 3 additions and 4 deletions

View File

@ -787,14 +787,13 @@ class Geom:
New material indices.
"""
mapper = dict(zip(from_material,to_material))
def mp(entry):
def mp(entry,mapper):
return mapper[entry] if entry in mapper else entry
mp = np.vectorize(mp)
mapper = dict(zip(from_material,to_material))
return Geom(material = mp(self.material).reshape(self.grid),
return Geom(material = mp(self.material,mapper).reshape(self.grid),
size = self.size,
origin = self.origin,
comments = self.comments+[util.execution_stamp('Geom','substitute')],