added volume read and write to xml

This commit is contained in:
Ethan Peterson 2022-10-19 14:16:52 -04:00
parent 7d6bdd1eef
commit e64fb4cd41

View file

@ -634,6 +634,9 @@ class Cell(IDManagerMixin):
if self.rotation is not None:
element.set("rotation", ' '.join(map(str, self.rotation.ravel())))
if self.volume is not None:
element.set("volume", str(self.volume))
return element
@classmethod
@ -687,6 +690,9 @@ class Cell(IDManagerMixin):
c.temperature = [float(t_i) for t_i in t.split()]
else:
c.temperature = float(t)
v = get_text(elem, 'volume')
if v is not None:
c.volume = float(v)
for key in ('temperature', 'rotation', 'translation'):
value = get_text(elem, key)
if value is not None: