| 96 | |
| 97 | |
| 98 | class JSONOutputFormat(KVWriter): |
| 99 | def __init__(self, filename): |
| 100 | self.file = open(filename, "wt") |
| 101 | |
| 102 | def writekvs(self, kvs): |
| 103 | for k, v in sorted(kvs.items()): |
| 104 | if hasattr(v, "dtype"): |
| 105 | kvs[k] = float(v) |
| 106 | self.file.write(json.dumps(kvs) + "\n") |
| 107 | self.file.flush() |
| 108 | |
| 109 | def close(self): |
| 110 | self.file.close() |
| 111 | |
| 112 | |
| 113 | class CSVOutputFormat(KVWriter): |
no outgoing calls
no test coverage detected