Skip to main content

Wrapper project of plotly.py, extra functionalities for scientific plots

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. AbhishekReports (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.AbhishekReports()
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.0.tar.gz (18.1 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.0-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lime_internal_getter-0.3.0.tar.gz
  • Upload date:
  • Size: 18.1 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.0.tar.gz
Algorithm Hash digest
SHA256 35ecb1e41528c2c46d4db7d6c06241ecd686977122046fafb744fd37969af2d0
MD5 18237a1d82b4102dd32b1e0b50b0c2ae
BLAKE2b-256 bc7be6255abe8225f08cd31baea3e1a289fa67333254c4521727dd30d8965a72

See more details on using hashes here.

Provenance

The following attestation bundles were made for lime_internal_getter-0.3.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lime_internal_getter-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 486b291dbc04fee91b78271fddcd03c0793339020e5323ed5d36fd624e777662
MD5 d77bd8a78c47e45f1b208aa3d0e02e20
BLAKE2b-256 4ada9c3a9d682d141f1e4ea40573420e7c6e7a3bd8f021d28c19d112f079e300

See more details on using hashes here.

Provenance

The following attestation bundles were made for lime_internal_getter-0.3.0-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