File size: 691 Bytes
c587d34
 
 
 
 
05a4c82
 
 
 
 
c587d34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import json
import numpy as np

from .metrics.tools import get_tools_metrics
from .metrics.machine import get_machine_metrics

def process(raw_data):
    """
    Process the raw production data to extract metrics.
    """
    print("=== TOOLS METRICS ===\n")
    tools_dfs = get_tools_metrics(raw_data)
    tools_dfs = {tool: df for tool, df in tools_dfs.items() if not df.empty}

    for tool, df in tools_dfs.items():
        print(tool)
        print(df.head())
        print("\n")

    print("=== MACHINE METRICS ===")
    machine_results = get_machine_metrics(raw_data)
    machine_json = json.dumps(machine_results, indent=4)
    print(machine_json)

    return tools_dfs, machine_json