def test_import(): data = read_csv("UTEC.csv") d = DynoRun() d.Import(data, 0, sample_rate=5, afr_col=12) data = read_csv("smart2.csv") d = DynoRun() d.Import(data, 1, time_col=0, afr_col=3) data = read_csv("smart_smooth.csv") d = DynoRun() d.Import(data, 0, torque_col=1)
def Load(self, filename): """Load DynoRun from a text file. The file format specifices that lines beginning with '#' will be comments and that each line shall contain at least 3, comma delimited, numerical values. value 1: rpm value 2: torque value 3: rpm value 4: afr value 5: knock """ data = read_csv(filename) t = [] for line in data: if len(line) != 6: raise IOError, "Invalid file format" t.append((int(line[0]), float(line[1]), float(line[2]), float(line[3]), float(line[4]), float(line[5]))) self.data = t