Skip to content

Commit 098198b

Browse files
committed
har_trees: Avoid : in filenames
Is a protected character on Windows, and stripped by some tools like Label Studio
1 parent e5ff9f9 commit 098198b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/har_trees/recorder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
def format_time(secs):
1313
tt = time.gmtime(secs)
1414
year, month, day, hour, minute, second, _, _ = tt[0:8]
15-
formatted = f'{year:04d}-{month:02d}-{day:02d}T{hour:02d}:{minute:02d}:{second:02d}'
15+
formatted = f'{year:04d}-{month:02d}-{day:02d}T{hour:02d}{minute:02d}{second:02d}'
1616
return formatted
1717

1818
def file_or_dir_exists(filename):
@@ -65,7 +65,7 @@ def process(self, data):
6565
time_str = format_time(time.time())
6666
out_path = f'{self._directory}/{time_str}_{self._classname}{self._suffix}'
6767
out_typecode = 'h'
68-
out_shape = (3, self._recording_samples)
68+
out_shape = (self._recording_samples, 3)
6969
self._recording_file_path = out_path
7070
self._recording_file = npyfile.Writer(open(out_path, 'wb'), out_shape, out_typecode)
7171
self._recording_file._write_header()

0 commit comments

Comments
 (0)