new metrics in detailed view
Browse files- app.py +1 -0
- json/app_column_config.json +4 -0
- src/app_utils.py +3 -2
app.py
CHANGED
@@ -450,6 +450,7 @@ with gr.Blocks(title="Swift Stock Screener, by Reddgr") as front:
|
|
450 |
display_col = rename_columns.get("ticker", "ticker")
|
451 |
ticker = last_result_df.iloc[row_i][display_col]
|
452 |
print(f"DEBUG ticker extracted: {ticker}")
|
|
|
453 |
else:
|
454 |
# Filter by column returns (df, pagination_label, page_number, summary)
|
455 |
filtered_df, pagination, page, summary = filter_by_column(evt)
|
|
|
450 |
display_col = rename_columns.get("ticker", "ticker")
|
451 |
ticker = last_result_df.iloc[row_i][display_col]
|
452 |
print(f"DEBUG ticker extracted: {ticker}")
|
453 |
+
selected_ticker = ticker # keep global state in sync
|
454 |
else:
|
455 |
# Filter by column returns (df, pagination_label, page_number, summary)
|
456 |
filtered_df, pagination, page, summary = filter_by_column(evt)
|
json/app_column_config.json
CHANGED
@@ -13,6 +13,8 @@
|
|
13 |
"beta",
|
14 |
"beta_norm",
|
15 |
"category",
|
|
|
|
|
16 |
"country_num_norm",
|
17 |
"debtToEquity_norm",
|
18 |
"fullTimeEmployees_norm",
|
@@ -75,6 +77,8 @@
|
|
75 |
"country",
|
76 |
"sector",
|
77 |
"marketCap",
|
|
|
|
|
78 |
"ret_365",
|
79 |
"vol_365",
|
80 |
"trailingPE",
|
|
|
13 |
"beta",
|
14 |
"beta_norm",
|
15 |
"category",
|
16 |
+
"totalRevenue",
|
17 |
+
"ebitda",
|
18 |
"country_num_norm",
|
19 |
"debtToEquity_norm",
|
20 |
"fullTimeEmployees_norm",
|
|
|
77 |
"country",
|
78 |
"sector",
|
79 |
"marketCap",
|
80 |
+
"totalRevenue",
|
81 |
+
"ebitda",
|
82 |
"ret_365",
|
83 |
"vol_365",
|
84 |
"trailingPE",
|
src/app_utils.py
CHANGED
@@ -30,8 +30,9 @@ def format_results(df: pd.DataFrame, rename_columns: dict) -> pd.DataFrame:
|
|
30 |
df["Search dist."] = df["Search dist."].apply(lambda n: "-" if pd.isna(n) else f"{n:.2f}")
|
31 |
|
32 |
# Cantidades monetarias grandes
|
33 |
-
|
34 |
-
|
|
|
35 |
# Porcentajes 1 decimal
|
36 |
for col in ["ret_365", "revenueGrowth"]:
|
37 |
if col in df.columns:
|
|
|
30 |
df["Search dist."] = df["Search dist."].apply(lambda n: "-" if pd.isna(n) else f"{n:.2f}")
|
31 |
|
32 |
# Cantidades monetarias grandes
|
33 |
+
for col in ["marketCap", "totalRevenue", "ebitda"]:
|
34 |
+
if col in df.columns:
|
35 |
+
df[col] = df[col].apply(lambda n: "-" if pd.isna(n) else format_large_number(n, 1))
|
36 |
# Porcentajes 1 decimal
|
37 |
for col in ["ret_365", "revenueGrowth"]:
|
38 |
if col in df.columns:
|