ozreactor.data package¶
Submodules¶
ozreactor.data.data module¶
- class ozreactor.data.data.DataManager(config: ozreactor.config.config.OzConfig)¶
Bases:
objectOzReactor Data API provides high-level functionality for working with OzReactor’s data store. Supports storing and retrieving both cached and normalized datasets from within the data store, moving them into the user’s job directory to further be worked with.
- load_cached_file(file: str, copy: bool = False)¶
Load a file from the cache directory into the user’s set_dir directory. Creates a symlink between the cached file, and the job file.
- Parameters
file – The name of the file to load (including extension).
copy – If true, the file will be copied instead of symlinked (Default: False)
- Returns
file path of the loaded file in set_dir directory.
- load_tileset(timestamp: datetime.datetime)¶
Loads a tileset into the job directory.
- load_tilesets_from_daterange(from_time: datetime.datetime, to_time: datetime.datetime)¶
Loads a list of available tilesets within a date range.
- locate_cache_directory(file: str)¶
Check whether file exists within the cache directory.
- Parameters
file – The name of the file to check for (including extension).
- Returns
file path cache directory doesn’t exist, otherwise None
- store_tileset(tileset_path: str, timestamp: datetime.datetime)¶
Stores a processed directory from GDAL2Tiles output directory structure. Assumes the format (zoom / x / y.png) is provided as an output for GDAL. Moves processed files into OzReactor Normalized directory.
- ozreactor.data.data.build_directories(*paths: str)¶
Creates a list of directories if they do not exist.
- ozreactor.data.data.string_to_timestamp(timestamp_string: str)¶
- ozreactor.data.data.timestamp_to_string(timestamp: datetime.datetime)¶