flowmarg / core /utils.py
akash
Deploy to Hugging Face (source code only, no binary files)
2379054
Raw History Blame Contribute Delete
399 Bytes
import pandas as pd
def point_xy(row):
if row is None: return None
for prefix in ["offset_point","offset_line","center"]:
n = row.get(f"{prefix}_n")
e = row.get(f"{prefix}_e")
if n is not None and e is not None and pd.notna(n) and pd.notna(e):
if not (abs(float(n))<1e-9 and abs(float(e))<1e-9):
return float(n), float(e)
return None