l5kit.data.local_data_manager module

class l5kit.data.local_data_manager.DataManager

Bases: abc.ABC

abstract require(key: str) str
class l5kit.data.local_data_manager.LocalDataManager(local_data_folder: Optional[Union[str, pathlib.Path]] = None)

Bases: l5kit.data.local_data_manager.DataManager

LocalDataManager allows you to require data to be present in the subpath of a specific folder.

Example: Your data folder is set to "/tmp/my-data-folder", and you call local_data_manager.require("path/to/image.jpg"), it would check if "/tmp/my-data-folder/path/to/image.jpg" exists, and if so return that complete path ("/tmp/my-data-folder/path/to/image.jpg"), otherwise it raises an error.

In order of precedence, the local data folder is set by
  1. Passing in the path to the constructor of LocalDataManager

  2. Setting the L5KIT_DATA_FOLDER environment variable.

require(key: str) str

Require checks whether the file with the given key is present in the local data folder, if it is not it raises an error. Returns the path to the file otherwise.

Parameters

key (str) – Path from the data folder where the file or folder should be present.

Returns

str – Filepath including the data folder where required key is present.