From d0e70dad2a729293c4709d2da45317a5681ef30b Mon Sep 17 00:00:00 2001 From: Erick Ahmed Date: Mon, 13 Jul 2026 21:20:07 +0200 Subject: [PATCH] Remove leftovers --- utils/extractor.py | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 utils/extractor.py diff --git a/utils/extractor.py b/utils/extractor.py deleted file mode 100644 index 8cdd07e..0000000 --- a/utils/extractor.py +++ /dev/null @@ -1,27 +0,0 @@ -# File: extractor.py -# Copyright (C) 2026 Erick Ahmed -# SPDX-License-Identifier: AGPL-3.0-or-later - -import json -from pathlib import Path -import pandas as pd - -def extract_id(row: pd.Series) -> str: - """Extracts PGN from metadata or falls back to CAN ID.""" - meta = row.get('j1939_metadata') - if pd.isna(meta): - return f"ID: {row['ID']}" - if isinstance(meta, str): - try: - meta = json.loads(meta) - except json.JSONDecodeError: - return f"ID: {row['ID']}" - if isinstance(meta, dict) and 'PGN' in meta: - return f"PGN: {meta['PGN']}" - return f"ID: {row['ID']}" - -def load_data(file_path: Path) -> pd.DataFrame: - """Loads Parquet file and adds an Identifier column.""" - df = pd.read_parquet(file_path) - df['Identifier'] = df.apply(extract_id, axis=1) - return df