process-aware-ai / backend /debug_data_simple.py
borndeveloper's picture
Deploy Process Aware AI Dashboard without binaries
b4a2e7f
Raw
History Blame Contribute Delete
1.86 kB
import sys
import os
import pandas as pd
import json
# Ensure backend works
sys.path.append(os.getcwd())
# Hardcode paths from data_service.py to test directly
DATA_PATH = "/run/media/ishpreet/New Volume/Auribises/Vardhman Textiles/Final Base Data for PD Gr issue Norsm 15-01-26.xlsx"
NORMS_PATH = "/run/media/ishpreet/New Volume/Auribises/Vardhman Textiles/AT1 MKT PD Gr Norms Rev on 13-12-2025.xlsx"
print(f"Checking Data Path: {DATA_PATH}")
if os.path.exists(DATA_PATH):
print("βœ… Main Data File found")
try:
print("Reading 'PO Type' sheet...")
po_df = pd.read_excel(DATA_PATH, sheet_name="PO Type")
print(f"βœ… PO Type Loaded completely. Shape: {po_df.shape}")
print(po_df.head().to_string())
print("\nReading 'Finish Description' sheet...")
finish_df = pd.read_excel(DATA_PATH, sheet_name="Finish Description")
print(f"βœ… Finish Description Loaded completely. Shape: {finish_df.shape}")
print(finish_df.head().to_string())
except Exception as e:
print(f"❌ Error reading Excel: {e}")
else:
print("❌ Main Data File NOT found")
# Check fallback
fallback = "/run/media/ishpreet/New Volume/Auribises/Vardhman Textiles/Data Set.xlsx"
if os.path.exists(fallback):
print(f"⚠️ Fallback found at {fallback}")
else:
print(f"❌ Fallback NOT found either")
print("\nChecking Norms...")
norms_json = os.path.join(os.getcwd(), "data/norms.json")
if os.path.exists(norms_json):
print(f"βœ… Norms JSON found at {norms_json}")
try:
with open(norms_json, "r") as f:
norms = json.load(f)
print(f"βœ… Norms loaded: {len(norms)} entries")
except Exception as e:
print(f"❌ Error reading Norms JSON: {e}")
else:
print(f"❌ Norms JSON NOT found at {norms_json}")