Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix passing of tub metadata #1017

Merged
merged 3 commits into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions donkeycar/parts/datastore_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
import mmap
import os
import time
import logging
from pathlib import Path

logger = logging.getLogger(__name__)


NEWLINE = '\n'
NEWLINE_STRIP = '\r\n'
Expand Down Expand Up @@ -317,8 +320,13 @@ def _add_catalog(self):

def _read_metadata(self, metadata=[]):
self.metadata = dict()
for (key, value) in metadata:
self.metadata[key] = value
for kv in metadata:
kvs = kv.split(":")
if len(kvs) == 2:
self.metadata[kvs[0]] = kvs[1]
else:
logger.error(f'Metadata item needs to be a key value pair of '
f'format key:value, ignore entry {kv}')

def _read_contents(self):
self.seekeable.seek_line_start(1)
Expand Down
1 change: 1 addition & 0 deletions donkeycar/templates/complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,7 @@ def run(self, mode, recording):
# do we want to store new records into own dir or append to existing
tub_path = TubHandler(path=cfg.DATA_PATH).create_tub_path() if \
cfg.AUTO_CREATE_NEW_TUB else cfg.DATA_PATH
meta += getattr(cfg, 'METADATA', [])
tub_writer = TubWriter(tub_path, inputs=inputs, types=types, metadata=meta)
V.add(tub_writer, inputs=inputs, outputs=["tub/num_records"], run_condition='recording')

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def package_files(directory, strip_leading):
long_description = fh.read()

setup(name='donkeycar',
version="4.3.17",
version="4.3.18",
long_description=long_description,
description='Self driving library for python.',
url='https://github.com/autorope/donkeycar',
Expand Down