Add type annotations to functions and methods for improved clarity and maintainabiliy

This commit is contained in:
nemanjaASE
2025-03-09 13:50:18 +01:00
parent 21180b53e5
commit 71787c6ec9
4 changed files with 32 additions and 21 deletions
+4 -2
View File
@@ -1,5 +1,6 @@
import io
import string
from typing import List
import matplotlib.pyplot as plt
import numpy as np
@@ -7,8 +8,9 @@ import pandas as pd
from matplotlib.cm import ScalarMappable
from matplotlib.colors import LinearSegmentedColormap, Normalize
from .primitives import Table
def plot_security_report(table):
def plot_security_report(table: Table) -> io.BytesIO:
# Data preprocessing
data = pd.DataFrame(table)
@@ -141,7 +143,7 @@ def plot_security_report(table):
return buf
def generate_identifiers(data):
def generate_identifiers(data : pd.DataFrame) -> List[str]:
data_length = len(data)
alphabet = string.ascii_uppercase
num_letters = len(alphabet)