always add comment at beginning

usually, comments are related to the file history
This commit is contained in:
Martin Diehl 2019-05-26 21:32:48 +02:00
parent af493cf9fd
commit 0039ac9551
1 changed files with 4 additions and 2 deletions

View File

@ -83,9 +83,9 @@ class Geom():
def add_comment(self,comment):
if not isinstance(comment,list):
self.comments += [str(comment)]
self.comments = [str(comment)] + self.comments
else:
self.comments += [str(c) for c in comment]
self.comments = [str(c) for c in comment] + self.comments
def set_microstructure(self,microstructure):
self.microstructure = np.copy(microstructure)
@ -106,6 +106,8 @@ class Geom():
def get_homogenization(self):
return self.homogenization
def get_comments(self):
return self.comments[:]
@classmethod
def from_file(cls,fname):