Skip to main content

data handling library for Lime.ai

Project description

lime_internal_getter- A Data Handling Library for Lime.ai Documentation

Overview

This document provides a description of the functions defined in the lime_internal_getter package. The functions facilitate various operations including data fetching, IoT dashboard integration, data filtering, and process execution.


Functions

1. get_imei

Description: Retrieves the IMEI of a battery pack from the Lime.ai dashboard.

Parameters:

  • IMEI (str): The IMEI string of the device.

Returns:

  • IMEI (str): Retrieved IMEI of the battery pack.

Example Usage:

imei = get_imei("MD0AIOALAA00638")

2. get_pimdata

Description: Retrieves and processes IoT dashboard data for Local PIM testing.(Only for developers of PIM)

Parameters:

  • IMEI (str): IMEI of the device.
  • start_time (str): Start time in YYYY-MM-DD HH:MM format.
  • end_time (str): End time in YYYY-MM-DD HH:MM format.
  • filter_data (bool): Whether to filter data. Default is False.
  • serial_no (bool): Whether the input is a serial number. Default is False.
  • interpolation (bool): Whether to interpolate data. Default is True.
  • period (float): Interpolation period in seconds. Default is 0.1.
  • nas (bool): Use NAS storage if True. Default is True.

Returns:

  • DataFrame: A pandas DataFrame containing processed data.

Example Usage:

pim_data = get_pimdata("MD0AIOALAA00638", "2024-10-25 14:30", "2024-10-26 02:17")

3. get_fwdata

Description: Fetches a list of packs with specific firmware versions.

Parameters:

  • fWVersion (str): Firmware version to filter.
  • battery_prefix (str): Battery prefix for filtering.

Returns:

  • DataFrame: A pandas DataFrame containing the filtered data.

Example Usage:

fw_data = get_fwdata(fWVersion="8183D", battery_prefix="MH")

4. get_data

Description: Fetches battery data from NAS storage or IoT dashboard.

Parameters:

  • imei (str): IMEI or serial number.
  • start_time (str): Start time in YYYY-MM-DD HH:MM format.
  • end_time (str): End time in YYYY-MM-DD HH:MM format.
  • filter_data (bool): Whether to filter data. Default is False.
  • skip (bool): Skip missing files if True. Default is False.
  • nas (bool): Use NAS storage if True. Default is True.

Returns:

  • DataFrame: A pandas DataFrame containing fetched data.

Example Usage:

battery_data = get_data("MD0AIOALAA00638", "2024-10-25 14:30", "2024-10-26 02:17")

5. pim_make

Description: Executes the PIM model after setting configurations in C code.(Only for developers of PIM)

Parameters:

  • directory_path (str): Path to the directory containing PIM configurations.
  • model (int): Model type. Default is 4.
  • filename (str): File extension for the output. Default is "_iot_data.csv".

Example Usage:

pim_make("/path/to/directory", model=4, filename="_iot_data.csv")

6. PIMProcessor (Class)

Description: Class for processing PIM models and generating reports. (Not required for non-developers of PIM Model) results avaiable through some list of data through batch process as list

Methods:

  • __init__(directory_path, model,step): Initializes the processor.
  • fetch_and_process_data(...): Processes data for a list of serial numbers.
  • generate_final_table(save_csv): Generates the final data table.
  • plot(): Plots SOH comparison for packs.

Example Usage:

processor = PIMProcessor("/path/to/directory", model=4)
processor.fetch_and_process_data([...], "2024-06-27", "2024-06-28")
processor.correction_monitor()
print(processor.bms_errors)

7. KalmanFilter (Class)

Description: Class for running PIM models implemented locally through python (Not required for non-developers of PIM Model but can be used) soc and soh available through internal variable parameters

Methods:

  • __init__(model) : Initialises model parameters
  • process_filter(data): Performs Kalman filter for the given data
    • data a dataframe variable which has the structure: [Time in s,Current(A), Voltage 1 , Voltage2 ....]

Example Usage:

import lime_internal_getter as ig
kf= ig.KalmanFilter(model=9)
kf.process_filter(ig.get_pimdata("863674072212077",'2025-01-26')) #Put actual parameters here
print(kf.soc[0])# print soc for cell 1 corresponding to voltage 1 
print(kf.soh[0])# print soh for cell 1 corresponding to voltage 1

8. Reports (Class)

Description: Class for generating reports and corrections scripts for different firmware versions

Methods:

  • __init__(model): Generates a variable which has functionality of docx. Use df_todocx to update this and save using document.save(filpath+filename.docx)
  • df_to_docx(data) : Use this generate a table in the document for any dataframe
  • correction_script(fWlist,model,start_date) : Use for running correction monitor with different correction scripts in PIMProcessor class for big data in batch mode for processing entire firm like for max errors, errors in soc_ranges etc. . Example Usage:
import pandas as pd
import lime_internal_getter as ig
ar=ig.Reports()
ar.df_to_docx(pd.DataFrame([1,2,3],[1.1,2.5,4.2]),save=True)
fWlist=["51828"]
ar.correction_script(fWlist,model=3,start_date="2025-01-21")
#### Process for atleast 5 Min
print(pd.read_csv('51828.csv'))

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

lime_internal_getter-0.3.2.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lime_internal_getter-0.3.2-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file lime_internal_getter-0.3.2.tar.gz.

File metadata

  • Download URL: lime_internal_getter-0.3.2.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for lime_internal_getter-0.3.2.tar.gz
Algorithm Hash digest
SHA256 da5f33ccd98f814e56a58713fbb7ca1f164dfc76701ecb8148f923d62c4af8ec
MD5 be906068bc3f06debc549d142e74dd48
BLAKE2b-256 61549e908625d37c0bdcb4b58a8aa844e2c1d3cdcafc0a2cd0c336f303eeb9c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for lime_internal_getter-0.3.2.tar.gz:

Publisher: python-publish.yml on JonahTheDon/lime_internal_getter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lime_internal_getter-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for lime_internal_getter-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 539aa64392b052369201b767086a96e631ad8662eb5c686f5d8100c7d247669f
MD5 2b0edde86f35665699888ab7bc625268
BLAKE2b-256 3c1f13b9fb987c7f130d5269e89ec3ace1d4972d4d5c588bd5ed34cc850f860a

See more details on using hashes here.

Provenance

The following attestation bundles were made for lime_internal_getter-0.3.2-py3-none-any.whl:

Publisher: python-publish.yml on JonahTheDon/lime_internal_getter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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