File size: 1,858 Bytes
b4a2e7f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

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}")