Spaces:
Running
Running
Jon Solow
commited on
Commit
·
3e05990
1
Parent(s):
32ac9a4
Use hardcoded keeper list to set keepers to already be red
Browse files- src/pages/3_Draft_View.py +44 -1
src/pages/3_Draft_View.py
CHANGED
|
@@ -10,6 +10,45 @@ from shared_page import common_page_config
|
|
| 10 |
from streamlit_filter import filter_dataframe
|
| 11 |
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
@st.cache_data(ttl=60 * 60 * 24)
|
| 14 |
def load_yahoo_to_fp_id_map() -> dict[str, str]:
|
| 15 |
df = pd.read_csv(r"https://raw.githubusercontent.com/dynastyprocess/data/master/files/db_playerids.csv")
|
|
@@ -184,7 +223,11 @@ def get_page():
|
|
| 184 |
ecr_with_draft = ecr_data.merge(
|
| 185 |
draft_result[draft_result_merge_cols], how="outer", left_on="player_id", right_on="fp_id"
|
| 186 |
)
|
| 187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
|
| 189 |
# depth_charts = load_depth_charts()
|
| 190 |
# ecr_with_draft = ecr_with_draft.merge(depth_charts, how="left", left_on="player_id", right_on="fp_id")
|
|
|
|
| 10 |
from streamlit_filter import filter_dataframe
|
| 11 |
|
| 12 |
|
| 13 |
+
HARDCODED_KEEPERS_YAHOO_ID = {
|
| 14 |
+
2025: [
|
| 15 |
+
"40908",
|
| 16 |
+
"40168",
|
| 17 |
+
"30971",
|
| 18 |
+
"40899",
|
| 19 |
+
"40883",
|
| 20 |
+
"40993",
|
| 21 |
+
"32703",
|
| 22 |
+
"40196",
|
| 23 |
+
"40878",
|
| 24 |
+
"40881",
|
| 25 |
+
"40875",
|
| 26 |
+
"40118",
|
| 27 |
+
"33967",
|
| 28 |
+
"34007",
|
| 29 |
+
"31840",
|
| 30 |
+
"41048",
|
| 31 |
+
"30259",
|
| 32 |
+
"40063",
|
| 33 |
+
"40889",
|
| 34 |
+
"40059",
|
| 35 |
+
"31833",
|
| 36 |
+
"40905",
|
| 37 |
+
"40890",
|
| 38 |
+
"40877",
|
| 39 |
+
"33399",
|
| 40 |
+
"32685",
|
| 41 |
+
"40896",
|
| 42 |
+
"40041",
|
| 43 |
+
"33514",
|
| 44 |
+
"30994",
|
| 45 |
+
"34120",
|
| 46 |
+
"40084",
|
| 47 |
+
"34010",
|
| 48 |
+
]
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
|
| 52 |
@st.cache_data(ttl=60 * 60 * 24)
|
| 53 |
def load_yahoo_to_fp_id_map() -> dict[str, str]:
|
| 54 |
df = pd.read_csv(r"https://raw.githubusercontent.com/dynastyprocess/data/master/files/db_playerids.csv")
|
|
|
|
| 223 |
ecr_with_draft = ecr_data.merge(
|
| 224 |
draft_result[draft_result_merge_cols], how="outer", left_on="player_id", right_on="fp_id"
|
| 225 |
)
|
| 226 |
+
|
| 227 |
+
keepers_fp_id_list = HARDCODED_KEEPERS_YAHOO_ID.get(SEASON, {}).map(load_yahoo_to_fp_id_map())
|
| 228 |
+
ecr_with_draft["is_drafted"] = ecr_with_draft.apply(
|
| 229 |
+
lambda r: r.fp_id.notna() or r.player_id.isin(keepers_fp_id_list)
|
| 230 |
+
)
|
| 231 |
|
| 232 |
# depth_charts = load_depth_charts()
|
| 233 |
# ecr_with_draft = ecr_with_draft.merge(depth_charts, how="left", left_on="player_id", right_on="fp_id")
|