mirror of
https://github.com/msoedov/agentic_security.git
synced 2026-06-29 16:49:58 +02:00
Add type annotations to functions and methods for improved clarity and maintainabiliy
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user