diff --git a/umbra/filereader.py b/umbra/filereader.py index dd5ee4497a711673c3603726c9f5cdec545e33a2..444a04791a0a3c6999e81ec0068671529f3beea0 100644 --- a/umbra/filereader.py +++ b/umbra/filereader.py @@ -66,6 +66,7 @@ class CSVReader(FileReader): """ Args: path: string, the internal path to the source file + type: string, the type (source/shadow) of the source file. """ super().__init__(path) self._type = type # Very dirty fix @@ -150,7 +151,6 @@ class TxtWriter(FileWriter): final = np.append(final, "Skips: "+str(info[2])) np.savetxt(path, final, fmt="%s", header="Word|Shadowed") -# Untested def _participant_path(part_number): """ Create a path for the appropriate participant. @@ -189,11 +189,16 @@ class CSVWriter(FileWriter): writer.writerow(info) def write_multiple(self, dir, dict): + """ + Write multiple CSV files. + Args: + dir (string), the directory paths + dict (dictionary), dictionary containing results + """ for key, results in dict.items(): path = self._participant_path(dir, key) self.write(path, results) - # TODO: Test per-participant writing def _participant_path(self, dir, key): """ Create a path for the appropriate participant. diff --git a/umbra/model.py b/umbra/model.py index 702f161d7c0b7158e3b19ea536b8d8976a72ffa8..ae4532c0742b3c60dac3e5add5f51fef84531054 100644 --- a/umbra/model.py +++ b/umbra/model.py @@ -71,7 +71,7 @@ class Model: if self._id is ut.filter_key(key): result = self._stats.analyze(self._data_source, data) - self.add_to_dict(key+"_res", result, self._multi_results) + ut.add_to_dict(key+"_res", result, self._multi_results) else: pass else: diff --git a/umbra/umbra.py b/umbra/umbra.py index ed32cc2f2eca8f59f8281459bb9bcd5d2c36afab..9b5a64b2e2f14fa046dcbc73452440817cad14b4 100644 --- a/umbra/umbra.py +++ b/umbra/umbra.py @@ -15,6 +15,6 @@ class Umbra: """Start the main loop.""" self._controller.start() -B + if __name__ == "__main__": Umbra().main()