peppinob-ol commited on
Commit
9b97db2
Β·
1 Parent(s): 406b7cb

Fix: use absolute path directly for just-generated graphs to avoid path resolution issues

Browse files
Files changed (1) hide show
  1. eda/pages/00_Graph_Generation.py +3 -22
eda/pages/00_Graph_Generation.py CHANGED
@@ -359,33 +359,14 @@ if just_generated and generated_path:
359
  # Auto-select the just-generated graph
360
  from pathlib import Path as PathLib
361
 
362
- # Convert to Path and handle both absolute and relative paths
363
  gen_path = PathLib(generated_path)
364
 
365
- # Try to make path relative to parent_dir
366
- try:
367
- if gen_path.is_absolute():
368
- # Try to make it relative to parent_dir
369
- try:
370
- selected_json = str(gen_path.relative_to(parent_dir))
371
- except ValueError:
372
- # Path is not relative to parent_dir, use absolute path
373
- selected_json = str(gen_path)
374
- else:
375
- # Already relative - use as is
376
- selected_json = str(gen_path).replace('\\', '/')
377
- except Exception as e:
378
- # Fallback: use absolute path
379
- selected_json = str(gen_path)
380
 
381
  st.info(f"πŸ“Š **Ready to analyze**: `{gen_path.name}` (just generated)")
382
 
383
- # Debug: show actual file location
384
- if gen_path.exists():
385
- st.success(f"βœ… File exists at: `{str(gen_path)}`")
386
- else:
387
- st.error(f"⚠️ File not found at: `{str(gen_path)}`")
388
-
389
  # Option to select a different file
390
  with st.expander("πŸ“ Select a different graph file", expanded=False):
391
  json_dir = parent_dir / "output" / "graph_data"
 
359
  # Auto-select the just-generated graph
360
  from pathlib import Path as PathLib
361
 
362
+ # Use the absolute path directly - we know it exists
363
  gen_path = PathLib(generated_path)
364
 
365
+ # Store the absolute path for use later
366
+ selected_json = str(gen_path)
 
 
 
 
 
 
 
 
 
 
 
 
 
367
 
368
  st.info(f"πŸ“Š **Ready to analyze**: `{gen_path.name}` (just generated)")
369
 
 
 
 
 
 
 
370
  # Option to select a different file
371
  with st.expander("πŸ“ Select a different graph file", expanded=False):
372
  json_dir = parent_dir / "output" / "graph_data"