From f63e8fe34ecd88c72c9bc2d1b3e7d6cb258cf6e5 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 25 Jun 2018 13:43:34 +0200 Subject: [PATCH] avoid specifying per-family-values for inactive families --- PRIVATE | 2 +- lib/damask/config/material.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/PRIVATE b/PRIVATE index c9eed7180..d8ab8056d 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit c9eed718041d098d7695871c1b123eae950b141d +Subproject commit d8ab8056d6245ce42bec8953de9af1d7754867cf diff --git a/lib/damask/config/material.py b/lib/damask/config/material.py index a56c5d976..b070e986f 100644 --- a/lib/damask/config/material.py +++ b/lib/damask/config/material.py @@ -267,3 +267,14 @@ class Material(): if newlen is not oldlen: print('Length of value was changed from %i to %i!'%(oldlen,newlen)) + def add_value(self, part=None, + section=None, + key=None, + value=None): + if not isinstance(value,list): + if not isinstance(value,str): + value = '%s'%value + value = [value] + print('adding %s:%s:%s with value %s '%(part.lower(),section.lower(),key.lower(),value)) + self.data[part.lower()][section.lower()][key.lower()] = value + self.data[part.lower()][section.lower()]['__order__'] += [key.lower()]