Skip to content

Commit f11ee1a

Browse files
committed
shiftung radar to chaoss page
Signed-off-by: Akshat Baranwal <[email protected]>
1 parent 8bbed1a commit f11ee1a

3 files changed

Lines changed: 14 additions & 8 deletions

File tree

8Knot/pages/chaoss/chaoss.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# import visualization cards
77
from .visualizations.project_velocity import gc_project_velocity
88
from .visualizations.contrib_importance_pie import gc_contrib_importance_pie
9+
from .visualizations.contributor_radar import gc_contributor_radar
910

1011
warnings.filterwarnings("ignore")
1112

@@ -21,6 +22,13 @@
2122
align="center",
2223
style={"marginBottom": ".5%"},
2324
),
25+
dbc.Row(
26+
[
27+
dbc.Col(gc_contributor_radar, width=6),
28+
],
29+
align="center",
30+
style={"marginBottom": ".5%"},
31+
),
2432
],
2533
fluid=True,
2634
)

8Knot/pages/contributors/visualizations/contributor_radar.py renamed to 8Knot/pages/chaoss/visualizations/contributor_radar.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,15 @@ def generate_radar_chart_from_data(start_date, end_date, repolist, bot_switch):
149149
start = time.perf_counter()
150150

151151
# GET ALL DATA FROM POSTGRES CACHE
152-
df_raw = cf.retrieve_from_cache(tablename=func_name, repolist=repolist)
152+
df = cf.retrieve_from_cache(tablename=func_name, repolist=repolist)
153153

154154
# test if there is data
155-
if df_raw.empty:
155+
if df.empty:
156156
logging.warning(f"{VIZ_ID} - NO DATA AVAILABLE")
157157
return nodata_graph()
158158

159159
# function for all data pre processing
160-
df = process_data(df_raw, start_date, end_date, bot_switch)
160+
df = process_data(df, start_date, end_date, bot_switch)
161161

162162
if df.empty:
163163
logging.warning(f"{VIZ_ID} - NO DATA AVAILABLE AFTER PROCESSING")
@@ -169,13 +169,13 @@ def generate_radar_chart_from_data(start_date, end_date, repolist, bot_switch):
169169
return fig
170170

171171

172-
def process_data(df_raw: pd.DataFrame, start_date, end_date, bot_switch):
172+
def process_data(df: pd.DataFrame, start_date, end_date, bot_switch):
173173
"""Process the raw contributor data and filter by date range and bot switch."""
174-
df_raw['created_at'] = pd.to_datetime(df_raw['created_at'], utc=True)
174+
df['created_at'] = pd.to_datetime(df['created_at'], utc=True)
175175
start_date_dt = pd.to_datetime(start_date, utc=True)
176176
end_date_dt = pd.to_datetime(end_date, utc=True)
177177

178-
df_filtered = df_raw[(df_raw['created_at'] >= start_date_dt) & (df_raw['created_at'] <= end_date_dt)]
178+
df_filtered = df[(df['created_at'] >= start_date_dt) & (df['created_at'] <= end_date_dt)]
179179
if df_filtered.empty:
180180
return pd.DataFrame()
181181

8Knot/pages/contributors/cntrb_behavior.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from .visualizations.contributors_types_over_time import gc_contributors_over_time
1010
from .visualizations.active_drifting_contributors import gc_active_drifting_contributors
1111
from .visualizations.new_contributor import gc_new_contributor
12-
from .visualizations.contributor_radar import gc_contributor_radar
1312
from .visualizations.contributor_funnel import gc_contributor_funnel, gc_contributor_dropoff
1413

1514

@@ -38,7 +37,6 @@
3837
dbc.Row(
3938
[
4039
dbc.Col(gc_contributors_over_time, width=6),
41-
dbc.Col(gc_contributor_radar, width=6),
4240
],
4341
align="center",
4442
style={"marginBottom": ".5%"},

0 commit comments

Comments
 (0)