From 9283702fc170414ae97ae6a7c77831c80d2fd2de Mon Sep 17 00:00:00 2001 From: Manuel Zingl Date: Thu, 6 Nov 2014 15:39:48 +0100 Subject: [PATCH] [transport] Change names, correct some issues in merge Simplify writing/reading from h5 --- python/converters/wien2k_converter.py | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/python/converters/wien2k_converter.py b/python/converters/wien2k_converter.py index 7c77a228..c39c4b4b 100644 --- a/python/converters/wien2k_converter.py +++ b/python/converters/wien2k_converter.py @@ -59,7 +59,6 @@ class Wien2kConverter(ConverterTools): self.oubwin_file = filename+'.oubwin' # Checks if h5 file is there and repacks it if wanted: - import os.path if (os.path.exists(self.hdf_file) and repacking): ConverterTools.repack(self) @@ -535,28 +534,13 @@ class Wien2kConverter(ConverterTools): print "Read in %s files done!" %self.oubwin_file - # Put data to HDF5 file ar = HDFArchive(self.hdf_file, 'a') if not (self.transp_subgrp in ar): ar.create_group(self.transp_subgrp) - # The subgroup containing the data. If it does not exist, it is created. - # If it exists, the data is overwritten!!! - - # Data from .pmat file - ar[self.transp_subgrp]['bandwin_opt'] = bandwin_opt - ar[self.transp_subgrp]['kp'] = kp - ar[self.transp_subgrp]['vk'] = vk - # Data from .struct file - ar[self.transp_subgrp]['latticetype'] = latticetype - ar[self.transp_subgrp]['latticeconstants'] = latticeconstants - ar[self.transp_subgrp]['latticeangles'] = latticeangles - # Data from .outputs file - ar[self.transp_subgrp]['nsymm'] = nsymm - ar[self.transp_subgrp]['symmcartesian'] = symmcartesian - ar[self.transp_subgrp]['taucartesian'] = taucartesian - # Data from .oubwin files - ar[self.transp_subgrp]['bandwin'] = bandwin - + # The subgroup containing the data. If it does not exist, it is created. If it exists, the data is overwritten!!! + things_to_save = ['bandwin_opt', 'kp', 'vk', 'latticetype', 'latticeconstants', 'latticeangles', 'nsymm', 'symmcartesian', + 'taucartesian', 'bandwin'] + for it in things_to_save: ar[self.transp_subgrp][it] = locals()[it] del ar def convert_symmetry_input(self, orbits, symm_file, symm_subgrp, SO, SP):