Skip to main content

Python Library for OKN Data Updater

Project description

OKN_PY_UPDATER

A python library to be used for live updating the okn data before sending into new version of okn detector.

Installation requirements and guide

Anaconda

To install this program, Anaconda python distributing program and Anaconda Powershell Prompt are needed.
If you do not have Anaconda, please use the following links to download and install:
Download link: https://www.anaconda.com/products/distribution
Installation guide link: https://docs.anaconda.com/anaconda/install/

PIP install

The library name is called okn_py_updater.
To install okn_py_updater, you have to use Anaconda Powershell Prompt.
In Anaconda Powershell Prompt:

pip install okn_py_updater

Usage

example_updater = Updater(`config to be used`, `length of circular buffer`, `header array`, `drop rate`)
  1. config to be used: must be dictionary type of gazefilters.json which contains information such as Mappers, filters and Graph.
  2. length of circular buffer: must be integer type to define the length of buffer to be used.
  3. header array: must be array which contains strings which will specify the individual data name of the data array to be updated. Examples: header_array = ['x_value', 'y_value', 'x_nom', 'y_nom', 'record_timestamp', 'sensor_timestamp', 'frame_rate', 'is_event', 'event_id', 'direction']
  4. drop rate: must be integer type. If it is zero, all data will be used. If it is more than 1, every 1 data will be collected then it will drop the amount of drop rate. For example: If the drop rate is 2, every 1 data will be collected then 2 data will be dropped.

Example Usage

config_to_be_used = load_commented_json("gazefilters.json")
header_array = ['x_value', 'y_value', 'x_nom', 'y_nom', 'record_timestamp', 'sensor_timestamp', 'frame_rate',
                'is_event', 'event_id', 'direction']

example_updater = Updater(config_to_be_used, 100, header_array, 3)

out_put = example_updater.update(data)

Updater Class Specifications

Attributes

  1. config: The dictionary version of gazefilters.json which contains information such as Mappers, filters and Graph.
  2. filter_config: The filter information of the config.
  3. circular_buffer: The circular buffer with max length which will be defined by user.
  4. self.buffer_max_length: The max length of buffer.
  5. self.header_array: The header array which will be defined by user.
  6. self.data_drop_rate: The drop rate which will be defined by user.
  7. count: The count to be used as a counter if data drop rate is greater than zero.

Methods

  1. update(self, data_input): To store incoming data into circular buffer, update the buffer and return the last element of buffer.
  2. set_buffer(self, new_buffer_length): To update buffer.
  3. set_header_array(self, new_header_array): To update header array.
  4. set_drop_rate(self, new_drop_rate): To update drop rate.
  5. get_output_header_array(self): To get output header array.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

okn_py_updater-2.0.8.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

okn_py_updater-2.0.8-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file okn_py_updater-2.0.8.tar.gz.

File metadata

  • Download URL: okn_py_updater-2.0.8.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.7

File hashes

Hashes for okn_py_updater-2.0.8.tar.gz
Algorithm Hash digest
SHA256 df3c59aeabd1b6da7a9b37fce1de56b1ed73029641e9c1ee9cf97e1b22c8087a
MD5 14ec2da340f98d13581567783940caef
BLAKE2b-256 d6f611643f4b8d0487f0b1e798fd1b284cc212a6e7bfb18a7a815f71f409aca8

See more details on using hashes here.

File details

Details for the file okn_py_updater-2.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for okn_py_updater-2.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ad197ce5fcbf54ade7f8333d035cc06c6c41bdff7c66dbfbcd466b504576b385
MD5 e187e490f580a880637ada7dd4ac5c41
BLAKE2b-256 c10fc9fb61d7132e6185d91086a26508c131262c1c95d37ec39c599cfac04d5c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page