def get_objects_from_spec(*files): spec = list() for file in files: obj = abstract.load(file) if isinstance(obj, list): spec += obj else: spec.append(obj) if len(spec) != 2: raise Exception for obj in spec: if isinstance(obj, abstract.Array): array = obj elif isinstance(obj, abstract.BemSimulation): simulation = obj return simulation, array
def get_objects_from_spec(*files): spec = [] for file in files: obj = abstract.load(file) if isinstance(obj, list): spec += obj else: spec.append(obj) if len(spec) < 2: raise Exception arrays = [] for obj in spec: if isinstance(obj, abstract.Array): arrays.append(obj) elif isinstance(obj, abstract.MfieldSimulation): simulation = obj return [simulation,] + arrays