Detailed Description
A datafile used by a FlowElement / Engine to get calculate properties values.
Public Member Functions | |
| __init__ (self, flow_element, identifier, update_url_params=None, data=None, path="", temp_directory=tempfile.gettempdir(), create_temp_copy=True, auto_update=True, file_system_watcher=True, polling_interval=30, update_time_maximum_randomisation=10, verify_md5=True, decompress=True, download=True, verify_if_modified_since=True, update_on_start=False) | |
| Constructor for a DataFile. | |
| get_date_published (self) | |
| Function called to get the date the datafile was published. | |
| get_next_update (self) | |
| Function called to get the date of the next datafile version. | |
| refresh (self, identifier) | |
| Function called when datafile has been updated. | |
| get_update_url (self) | |
| Internal function that constructs the url for the datafile update service to use from the result of get_url_formatter. | |
| get_url_formatter (self) | |
| Function that constructs the url for the datafile update service to use. | |
Public Attributes | |
| flow_element = flow_element | |
| identifier = identifier | |
| update_url_params = update_url_params | |
| temp_directory = temp_directory | |
| create_temp_copy = create_temp_copy | |
| auto_update = auto_update | |
| file_system_watcher = file_system_watcher | |
| polling_interval = polling_interval | |
| update_time_maximum_randomisation = update_time_maximum_randomisation | |
| verify_md5 = verify_md5 | |
| decompress = decompress | |
| download = download | |
| verify_if_modified_since = verify_if_modified_since | |
| update_on_start = update_on_start | |
| bool | updated_on_start = False |
| data = data | |
| path = path | |
| bool | updating = False |
Constructor & Destructor Documentation
◆ __init__()
| fiftyone_pipeline_engines.datafile.DataFile.__init__ | ( | self, | |
| flow_element, | |||
| identifier, | |||
| update_url_params = None, | |||
| data = None, | |||
| path = "", | |||
| temp_directory = tempfile.gettempdir(), | |||
| create_temp_copy = True, | |||
| auto_update = True, | |||
| file_system_watcher = True, | |||
| polling_interval = 30, | |||
| update_time_maximum_randomisation = 10, | |||
| verify_md5 = True, | |||
| decompress = True, | |||
| download = True, | |||
| verify_if_modified_since = True, | |||
| update_on_start = False ) |
Constructor for a DataFile.
@type flow_element: FlowElement
- Parameters
-
flow_element The FlowElement using the datafile @type identifier : string identifier : Name of the datafile @type update_url_params: dict update_url_params Dictionary containing parameters used to construct the datafile update url @type data: mixed data Data to use in the datafile if kept in memory rather than file @type path: string path path to the data file itself @type temp_directory: string temp_directory temporary file location (defaults to the operating system defualt) @type create_temp_copy: bool create_temp_copy whether to copy datafile to temporary location when updating @type auto_update: bool auto_update: whether to automatically update the datafile when required @type file_system_watcher: bool file_system_watcher whether to check the datafile's path for changes and update the connected FlowElement's data automatically when the file is changed in the operating system @type polling_interval: int polling_interval How often to poll for updates to the datafile (minutes) @type update_time_maximum_randomisation : int update_time_maximum_randomisation : Maximum randomisation offset in seconds to polling time interval @type verify_md5 : bool verify_md5 : whether to check a 'content-md5' header in the data file update service against the datafile to verify its contents @type decompress: bool is the datafile gziped when returning from the update service? @type download: bool download should the datafile be downloaded or stored in memory @type update_on_start : bool update_on_start : When this is set to true the datafile is updated / downloaded immediately on initialisation. This is useful if no initial datafile is present. @type verify_if_modified_since : bool verify_if_modified_since : whether to check an "If-Modified-Since" header on the update service against the last datafile update date
Member Function Documentation
◆ get_date_published()
| fiftyone_pipeline_engines.datafile.DataFile.get_date_published | ( | self | ) |
Function called to get the date the datafile was published.
- Returns
- date: Date the datafile was published
◆ get_next_update()
| fiftyone_pipeline_engines.datafile.DataFile.get_next_update | ( | self | ) |
Function called to get the date of the next datafile version.
- Returns
- date: Date of the next update
◆ get_update_url()
| fiftyone_pipeline_engines.datafile.DataFile.get_update_url | ( | self | ) |
Internal function that constructs the url for the datafile update service to use from the result of get_url_formatter.
◆ get_url_formatter()
| fiftyone_pipeline_engines.datafile.DataFile.get_url_formatter | ( | self | ) |
Function that constructs the url for the datafile update service to use.
◆ refresh()
| fiftyone_pipeline_engines.datafile.DataFile.refresh | ( | self, | |
| identifier ) |
Function called when datafile has been updated.
Defaults to a refresh method on the attached FlowElement @type identifier : string
- Parameters
-
identifier : identifier of the datafile
Member Data Documentation
◆ auto_update
| fiftyone_pipeline_engines.datafile.DataFile.auto_update = auto_update |
◆ create_temp_copy
| fiftyone_pipeline_engines.datafile.DataFile.create_temp_copy = create_temp_copy |
◆ data
| fiftyone_pipeline_engines.datafile.DataFile.data = data |
◆ decompress
| fiftyone_pipeline_engines.datafile.DataFile.decompress = decompress |
◆ download
| fiftyone_pipeline_engines.datafile.DataFile.download = download |
◆ file_system_watcher
| fiftyone_pipeline_engines.datafile.DataFile.file_system_watcher = file_system_watcher |
◆ flow_element
| fiftyone_pipeline_engines.datafile.DataFile.flow_element = flow_element |
◆ identifier
| fiftyone_pipeline_engines.datafile.DataFile.identifier = identifier |
◆ path
| fiftyone_pipeline_engines.datafile.DataFile.path = path |
◆ polling_interval
| fiftyone_pipeline_engines.datafile.DataFile.polling_interval = polling_interval |
◆ temp_directory
| fiftyone_pipeline_engines.datafile.DataFile.temp_directory = temp_directory |
◆ update_on_start
| fiftyone_pipeline_engines.datafile.DataFile.update_on_start = update_on_start |
◆ update_time_maximum_randomisation
| fiftyone_pipeline_engines.datafile.DataFile.update_time_maximum_randomisation = update_time_maximum_randomisation |
◆ update_url_params
| fiftyone_pipeline_engines.datafile.DataFile.update_url_params = update_url_params |
◆ updated_on_start
| bool fiftyone_pipeline_engines.datafile.DataFile.updated_on_start = False |
◆ updating
| bool fiftyone_pipeline_engines.datafile.DataFile.updating = False |
◆ verify_if_modified_since
| fiftyone_pipeline_engines.datafile.DataFile.verify_if_modified_since = verify_if_modified_since |
◆ verify_md5
| fiftyone_pipeline_engines.datafile.DataFile.verify_md5 = verify_md5 |
