def savexml(self, file, type="ascii", clobber=True): """ Saves the class to XML file Input: file: Filename to writable file (str) type: Filetype (str) clobber: Allow clobbering files? (any boolean) """ if lib.xmlsaveGasAbsLookup(self.__data__, *correct_save_arguments(file, type, clobber)): raise OSError("Cannot save {}".format(file))
def savexml(self, file, type="ascii", clobber=True): """ Saves the class to XML file Input: file: Filename to writable file (str) type: Filetype (str) clobber: Allow clobbering files? (any boolean) """ if not self.OK: raise RuntimeError("Class in bad state") if lib.xmlsaveEnergyLevelMap(self.__data__, *correct_save_arguments(file, type, clobber)): raise OSError("Cannot save {}".format(file))
def savexml(self, file, type="ascii", clobber=True): """ Saves the class to XML file Input: file: Filename to writable file (str) type: Filetype (str) clobber: Allow clobbering files? (any boolean) """ if not self.OK: raise ValueError("Cannot store; class is not OK") if lib.xmlsaveAbsorptionLines( self.__data__, *correct_save_arguments(file, type, clobber)): raise OSError("Cannot save {}".format(file))