Skip to main content

Python library useful tools for ABI Eye Health Diagnostic Group

Project description

EYE HEALTH DIAGNOSTIC GROUP's TOOLS (ehdg_tools)

Python library for eye health diagnostic group of Auckland Bioengineering Institude.

List of Tools

  1. TinyFillBuffer

TinyFillBuffer

Buffer Length

It is the buffer to fill the gap between the data.
The size of the gap that can be filled depands on the size of the buffer.

For example:

To fill the 10 data length gap, the buffer length must be atleast 12 because it needs 1 valid data at the front and at the back to be referenced.
Default size of the buffer is 7.
The minimum size of the buffer is 3.

Fill Method

As we are dealing with pupil data, most of our data are float.
Any nan data, zero data or string data between float data will be assumed as the gap.

For example:

In the x_value column in csv,
340.33
350.33
NaN
NaN
380.33

It will note that there is 2 data length gap and will be filled as follow:
340.33
350.33
360.33
370.33
380.33
In this case, the buffer length must be atleast 4.

The other data column apart from float column such as string or image will be keep as it is because there is no valid data to be referenced.

Class Attribute

self.buffer

The main buffer which is handling the filling function.

self.buffer_max_length

The length of buffer which can be initiated.

self.previous_data

The data recently released from the buffer.

self.data_attribute_array

The attribute array of the data such as x_value, y_value.
It starts as empty array and when the first data come in, it records the data attribute.

Installation

pip install ehdg_tools

To upgrade the python library

pip install ehdg_tools -U

Usage in Python

from ehdg_tools.ehdg_buffers import TinyFillBuffer
import numpy as np

fill_buffer = TinyFillBuffer(7)

example_valid_data = {"x_value": 7, "y_value": 10}
example_gap_data = {"x_value": "Nan", "y_value": np.nan}
count = 0

while True:
    if count % 2 == 0:
        return_data = fill_buffer.add(example_valid_data)
    else:
        return_data = fill_buffer.add(example_gap_data)
    print(return_data)
    count += 1

In this code, the while loop is adding the example_valid_data when the count is even and adding the example_gap_data when the count is odd.
But the return_data will be all valid data.

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

ehdg_tools-3.0.1.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

ehdg_tools-3.0.1-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file ehdg_tools-3.0.1.tar.gz.

File metadata

  • Download URL: ehdg_tools-3.0.1.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.7

File hashes

Hashes for ehdg_tools-3.0.1.tar.gz
Algorithm Hash digest
SHA256 acdec2c273abad0afa7e3f994771a7dfcf52b25018687e520dbe69cb2658cef5
MD5 e7970cf354cc73d245bf6e69ec091e66
BLAKE2b-256 1e9a1bdbd2bdbcfc4292ae74b5f3cc011ada3a4847e027d51b8828c4c7c39d5d

See more details on using hashes here.

File details

Details for the file ehdg_tools-3.0.1-py3-none-any.whl.

File metadata

  • Download URL: ehdg_tools-3.0.1-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.7

File hashes

Hashes for ehdg_tools-3.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 092f30e4a9afb78ea72fe1c2b5a6d4c73e15b93209f480c58117b43c9983cadc
MD5 ad73c5a1a9a9e6c58eef27f2f8d78a76
BLAKE2b-256 d5483f7f6b3b686ea1e2ad1c27eb93d122ec08e12fa10c8e63d94815510009ad

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