add func parm type

This commit is contained in:
2025-07-12 17:33:38 +02:00
parent b1ce9061b1
commit 7edaef3563
32 changed files with 301 additions and 75 deletions

View File

@@ -8,14 +8,14 @@ from itertools import islice
logger = logging.getLogger(__name__)
async def get_data(cfg: object, id: int, pool) -> tuple:
async def get_data(cfg: object, id: int, pool: object) -> tuple:
"""
Retrieves unit name, tool name, and tool data for a given record ID from the database.
Args:
cfg (object): Configuration object containing database table name.
id (int): The ID of the record to retrieve.
pool: The database connection pool.
pool (object): The database connection pool.
Returns:
tuple: A tuple containing unit_name, tool_name, and tool_data.
"""
@@ -26,14 +26,14 @@ async def get_data(cfg: object, id: int, pool) -> tuple:
return unit_name, tool_name, tool_data
async def make_pipe_sep_matrix(cfg: object, id: int, pool) -> list:
async def make_pipe_sep_matrix(cfg: object, id: int, pool: object) -> list:
"""
Processes pipe-separated data from a CSV record into a structured matrix.
Args:
cfg (object): Configuration object.
id (int): The ID of the CSV record.
pool: The database connection pool.
pool (object): The database connection pool.
Returns:
list: A list of lists, where each inner list represents a row in the matrix.
"""
@@ -58,14 +58,14 @@ async def make_pipe_sep_matrix(cfg: object, id: int, pool) -> list:
return matrice_valori
async def make_ain_din_matrix(cfg: object, id: int, pool) -> list:
async def make_ain_din_matrix(cfg: object, id: int, pool: object) -> list:
"""
Processes analog and digital input data from a CSV record into a structured matrix.
Args:
cfg (object): Configuration object.
id (int): The ID of the CSV record.
pool: The database connection pool.
pool (object): The database connection pool.
Returns:
list: A list of lists, where each inner list represents a row in the matrix.
"""
@@ -92,14 +92,14 @@ async def make_ain_din_matrix(cfg: object, id: int, pool) -> list:
return matrice_valori
async def make_channels_matrix(cfg: object, id: int, pool) -> list:
async def make_channels_matrix(cfg: object, id: int, pool: object) -> list:
"""
Processes channel-based data from a CSV record into a structured matrix.
Args:
cfg (object): Configuration object.
id (int): The ID of the CSV record.
pool: The database connection pool.
pool (object): The database connection pool.
Returns:
list: A list of lists, where each inner list represents a row in the matrix.
"""
@@ -120,14 +120,14 @@ async def make_channels_matrix(cfg: object, id: int, pool) -> list:
return matrice_valori
async def make_musa_matrix(cfg: object, id: int, pool) -> list:
async def make_musa_matrix(cfg: object, id: int, pool: object) -> list:
"""
Processes 'Musa' specific data from a CSV record into a structured matrix.
Args:
cfg (object): Configuration object.
id (int): The ID of the CSV record.
pool: The database connection pool.
pool (object): The database connection pool.
Returns:
list: A list of lists, where each inner list represents a row in the matrix.
"""
@@ -153,14 +153,14 @@ async def make_musa_matrix(cfg: object, id: int, pool) -> list:
return matrice_valori
async def make_tlp_matrix(cfg: object, id: int, pool) -> list:
async def make_tlp_matrix(cfg: object, id: int, pool: object) -> list:
"""
Processes 'TLP' specific data from a CSV record into a structured matrix.
Args:
cfg (object): Configuration object.
id (int): The ID of the CSV record.
pool: The database connection pool.
pool (object): The database connection pool.
Returns:
list: A list of lists, where each inner list represents a row in the matrix.
"""
@@ -180,14 +180,14 @@ async def make_tlp_matrix(cfg: object, id: int, pool) -> list:
async def make_gd_matrix(cfg: object, id: int, pool) -> list:
async def make_gd_matrix(cfg: object, id: int, pool: object) -> list:
"""
Processes 'GD' specific data from a CSV record into a structured matrix.
Args:
cfg (object): Configuration object.
id (int): The ID of the CSV record.
pool: The database connection pool.
pool (object): The database connection pool.
Returns:
list: A list of lists, where each inner list represents a row in the matrix.
"""