feat: substituir guardar_json pelo utils.save_as_json

Mudei um pouco o save_as_json e talvez tenha ficado um pouco nojento porque não sabia muito bem como fazer uso das EVENT_COLS e STATION_COLS de dentro do utils.py
This commit is contained in:
aulojor
2025-11-15 22:26:26 -01:00
parent afef4c4d5c
commit a9839e64bf
2 changed files with 5 additions and 4 deletions

View File

@@ -9,9 +9,10 @@ from typing import Any
import pandas as pd
def save_as_json(info: dict[str, Any]) -> bool:
with open("test.json", "w") as fp:
json.dump(info, fp)
def save_as_json(df: pd.DataFrame, fname, event_cols, station_cols) -> bool:
info = create_dict_struct(df, event_cols, station_cols)
with open(fname, "w") as fp:
json.dump(info, fp, indent=4)
return True