Spaces:
Running
Running
Jon Solow
commited on
Commit
·
2e0b4a6
1
Parent(s):
f18ed57
Update football icon and format rules for lint
Browse files- src/Home.py +9 -5
- src/config.py +1 -0
- src/pages/1_Keepers.py +3 -2
- src/pages/2_Rules.py +20 -11
src/Home.py
CHANGED
@@ -1,18 +1,22 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
-
from config import LEAGUE_NAME
|
4 |
|
5 |
|
6 |
def get_app():
|
7 |
keeper_title = f"{LEAGUE_NAME}"
|
8 |
-
st.set_page_config(page_title=keeper_title,
|
9 |
|
10 |
-
st.markdown(
|
|
|
11 |
Welcome {LEAGUE_NAME}!
|
12 |
|
13 |
-
Navigate between pages using the left sidebar.
|
|
|
|
|
14 |
|
15 |
-
"""
|
|
|
16 |
|
17 |
|
18 |
if __name__ == "__main__":
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
+
from config import DEFAULT_ICON, LEAGUE_NAME
|
4 |
|
5 |
|
6 |
def get_app():
|
7 |
keeper_title = f"{LEAGUE_NAME}"
|
8 |
+
st.set_page_config(page_title=keeper_title, page_icon=DEFAULT_ICON)
|
9 |
|
10 |
+
st.markdown(
|
11 |
+
f"""
|
12 |
Welcome {LEAGUE_NAME}!
|
13 |
|
14 |
+
Navigate between pages using the left sidebar.
|
15 |
+
|
16 |
+
If the sidebar is not visible, click the **>** in the upper left corner to open.
|
17 |
|
18 |
+
"""
|
19 |
+
)
|
20 |
|
21 |
|
22 |
if __name__ == "__main__":
|
src/config.py
CHANGED
@@ -1 +1,2 @@
|
|
1 |
LEAGUE_NAME = "LOFG"
|
|
|
|
1 |
LEAGUE_NAME = "LOFG"
|
2 |
+
DEFAULT_ICON = "🏉"
|
src/pages/1_Keepers.py
CHANGED
@@ -2,11 +2,12 @@ import os
|
|
2 |
import pandas as pd
|
3 |
import streamlit as st
|
4 |
|
5 |
-
from config import LEAGUE_NAME
|
6 |
|
7 |
|
8 |
KEEPER_DATA_URL = "../../tests/mocks/2023_keepers.csv"
|
9 |
|
|
|
10 |
@st.cache_data
|
11 |
def load_data():
|
12 |
data = pd.read_csv(os.path.join(os.path.dirname(__file__), KEEPER_DATA_URL), index_col=0)
|
@@ -40,7 +41,7 @@ def filtered_keeper_dataframe(data: pd.DataFrame, teams_list: list[str]):
|
|
40 |
|
41 |
def get_keeper_app():
|
42 |
keeper_title = f"{LEAGUE_NAME} Keeper Options"
|
43 |
-
st.set_page_config(page_title=keeper_title,
|
44 |
st.title(keeper_title)
|
45 |
data, teams_list = load_data()
|
46 |
|
|
|
2 |
import pandas as pd
|
3 |
import streamlit as st
|
4 |
|
5 |
+
from config import DEFAULT_ICON, LEAGUE_NAME
|
6 |
|
7 |
|
8 |
KEEPER_DATA_URL = "../../tests/mocks/2023_keepers.csv"
|
9 |
|
10 |
+
|
11 |
@st.cache_data
|
12 |
def load_data():
|
13 |
data = pd.read_csv(os.path.join(os.path.dirname(__file__), KEEPER_DATA_URL), index_col=0)
|
|
|
41 |
|
42 |
def get_keeper_app():
|
43 |
keeper_title = f"{LEAGUE_NAME} Keeper Options"
|
44 |
+
st.set_page_config(page_title=keeper_title, page_icon=DEFAULT_ICON)
|
45 |
st.title(keeper_title)
|
46 |
data, teams_list = load_data()
|
47 |
|
src/pages/2_Rules.py
CHANGED
@@ -1,25 +1,34 @@
|
|
1 |
import streamlit as st
|
2 |
|
|
|
3 |
|
4 |
-
|
|
|
|
|
|
|
5 |
st.markdown(
|
6 |
"""
|
7 |
***Note: First LOFG keeper season was 2019***
|
8 |
|
9 |
1. Teams can keep up to 3 players from the prior season.
|
10 |
- Note: changed from 2 to 3 beginning with 2022 season
|
11 |
-
2. Players are kept at the expense of a draft pick.
|
|
|
12 |
3. Players drafted in the 1st round of the prior season will not be eligible to keep.
|
13 |
-
4. Players drafted in rounds 2 and after can be kept at the expense of one higher round
|
14 |
-
|
|
|
15 |
- Changed beginning 2022 from 9th round
|
16 |
-
6.
|
17 |
-
-
|
18 |
-
|
19 |
-
|
20 |
-
-
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
23 |
In other words, keeper rights transfer with the trade
|
24 |
|
25 |
"""
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
+
from config import DEFAULT_ICON, LEAGUE_NAME
|
4 |
|
5 |
+
|
6 |
+
page_title = f"{LEAGUE_NAME} Keeper Rules"
|
7 |
+
st.set_page_config(page_title=page_title, page_icon=DEFAULT_ICON)
|
8 |
+
st.title(page_title)
|
9 |
st.markdown(
|
10 |
"""
|
11 |
***Note: First LOFG keeper season was 2019***
|
12 |
|
13 |
1. Teams can keep up to 3 players from the prior season.
|
14 |
- Note: changed from 2 to 3 beginning with 2022 season
|
15 |
+
2. Players are kept at the expense of a draft pick.
|
16 |
+
- The round of that draft pick will depend on when the player was drafted in the prior season.
|
17 |
3. Players drafted in the 1st round of the prior season will not be eligible to keep.
|
18 |
+
4. Players drafted in rounds 2 and after can be kept at the expense of one higher round
|
19 |
+
- Ex: player drafted in round 2 can be kept for your 1st round pick.
|
20 |
+
5. Players who were not drafted and were picked up during the season can be kept for 10th round picks (FA Keeper cost)
|
21 |
- Changed beginning 2022 from 9th round
|
22 |
+
6. Post-Draft Acquired Keeper cost Minimum -
|
23 |
+
- Players drafted by other teams have a keeper cost of minimum of round player drafted and FA Keeper Cost.
|
24 |
+
- This rewards people who drafted the players, versus those who picked them up off waivers.
|
25 |
+
7. If you select 2 players with the same keeper cost, one of the players would count as one round higher.
|
26 |
+
- Ex: Two players both have keeper cost of 10th round.
|
27 |
+
- One of those players would instead be counted as your 9th round pick if both are kept.
|
28 |
+
8. Players can not be kept for more than 2 consecutive seasons
|
29 |
+
- Ex: player drafted in 2019 in 6th round, 2020 for 5th round, and 2021 for 4th round - can't be kept in 2022
|
30 |
+
- Exception to the above rule is that players originally drafted in 2nd round can only be kept for one season.
|
31 |
+
9. Players traded in a season are not subject to the FA Keeper cost minimum cost
|
32 |
In other words, keeper rights transfer with the trade
|
33 |
|
34 |
"""
|