def execute(this, arguments, WORKINGMATRIX): filename = arguments[0] form = None if len(arguments) == 2: form = arguments[1] else: form = this.extrapolateFormat(arguments[0]) WORKINGMATRIX = libHercmIO.readMatrix(filename, form, True) return WORKINGMATRIX
def convert(source, destination, sourceFormat, destinationFormat): # converts the matrix at source in sourceFormat to destinationFormat # then writes out at destination if not os.path.exists(source): print("ERROR: load from nonexistent path") return if not os.path.isfile(source): print("ERROR: {0} is not a file".format(source)) return HERCMATRIX = libHercmIO.readMatrix(source, sourceFormat) HERCMATRIX.verification = libBXF.generateVerificationSum(HERCMATRIX) libHercmIO.writeMatrix(destination, destinationFormat, HERCMATRIX)