Skip to content

Commit 393cebb

Browse files
authored
enh: turn timeseries page into dashboard (#149)
* enh: turn time series into dashboard * enh: fix layout
1 parent 2d09039 commit 393cebb

File tree

2 files changed

+160
-234
lines changed

2 files changed

+160
-234
lines changed

peer-review/editorial-dashboard.qmd

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
---
1+
---
22
title: "pyOpenSci Editorial Dashboard"
3-
format:
3+
format:
44
dashboard:
5-
scrolling: true
5+
scrolling: true
66
execute:
77
echo: false
8-
---
8+
---
99

1010

1111
```{python}
@@ -33,24 +33,22 @@ warnings.filterwarnings("ignore")
3333
# Make tables nicer
3434
pd.set_option("display.max_colwidth", None)
3535
current_date = datetime.today().date()
36-
today = current_date.strftime("%d %B %Y")
37-
```
36+
today = current_date.strftime("%d %B %Y")
3837
3938
40-
```{python}
4139
def clean_and_order(df, DROP_COLS, order):
4240
"""Drop columns and reorder DataFrame columns."""
4341
return df.drop(columns=DROP_COLS, errors="ignore")[ORDER]
4442
4543
def get_status_df(df, status):
4644
return df[df["active_status"] == status].reset_index(drop=True)
4745
48-
DROP_COLS = ["date_accepted", "labels", "editor", "status", "active_status"]
46+
DROP_COLS = ["date_accepted", "labels", "editor", "status", "active_status"]
4947
ORDER = ["Name", "Description", "Days Open", "Date Opened","Last Comment", "Last User to Comment", "Issue", "Categories", "eic"]
5048
5149
label_map = {
5250
"pre-review": [
53-
"New Submission!",
51+
"New Submission!",
5452
"0/pre-review-checks"],
5553
"seeking editor": ["0/seeking-editor"],
5654
"seeking reviewers": ["2/seeking-reviewers"],
@@ -64,10 +62,10 @@ label_map = {
6462
}
6563
6664
def get_active_status(labels):
67-
"""A function that returns an review status value based on a list of
65+
"""A function that returns an review status value based on a list of
6866
label values available in the issue.
6967
"""
70-
68+
7169
for status, label_list in label_map.items():
7270
if any(label in labels for label in label_list):
7371
return status
@@ -76,8 +74,6 @@ def get_active_status(labels):
7674

7775

7876
```{python}
79-
#| echo: false
80-
8177
# Open submission review data
8278
data_path = Path.cwd().parents[0] / "_data" / "review_submissions.csv"
8379
reviews = pd.read_csv(data_path,
@@ -115,7 +111,7 @@ active_editor_counts = (
115111

116112
```{python}
117113
# Open editor team data
118-
# The total list is derived from the scripts/editors.py script which parses the (active) editorial team data.
114+
# The total list is derived from the scripts/editors.py script which parses the (active) editorial team data.
119115
# The data opened in this section is collected using the scripts/get-editors.py workflow.
120116
121117
editor_path = Path.cwd().parents[0] / "_data" / "editorial_team_domains.csv"
@@ -161,7 +157,6 @@ offboard_usernames = emeritus_editors["gh_username"]
161157
offboarding_editor_reviews = open_reviews[open_reviews["editor"].isin(offboard_usernames)].copy()
162158
```
163159

164-
165160
## Row {height=auto}
166161

167162
```{python}
@@ -200,16 +195,16 @@ dict(
200195
## Row {height=5%}
201196

202197
```{python}
203-
#| title: "pyOpenSci Current Active Editorial Review Counts"
198+
#| title: "pyOpenSci Current Active Editorial Review Counts"
204199
show(editor_activity)
205200
```
206201

207202
## Row {height=auto}
208203

209204
```{python}
210-
#| title: "Editors Leading Reviews That Are or Have Offboarded After"
205+
#| title: "Editors Leading Reviews That Are or Have Offboarded After"
211206
212-
# TODO: The table below is a good start but it should capture AMS lead by Nima as well. And the one that Chiara still has opened.
207+
# TODO: The table below is a good start but it should capture AMS lead by Nima as well. And the one that Chiara still has opened.
213208
print("Below are reviews that the peer review lead and Editor in Chief should watch. We may need to assign an additional editor the ensure these reviews moves forward.")
214209
215210
offboarding_editor_reviews = offboarding_editor_reviews.drop(columns=["date_accepted", "Categories"], errors="ignore")
@@ -279,7 +274,7 @@ edits = edits[edits["Year"] >= 2023]
279274
280275
```
281276

282-
## Editor Activity by Quarter
277+
## Editor Activity by Quarter
283278

284279
## Row {height=auto}
285280

@@ -317,18 +312,18 @@ df_full = (
317312
quarter_order = sorted(df["QuarterLabel"].unique())
318313
df["QuarterLabel"] = pd.Categorical(df["QuarterLabel"], categories=quarter_order, ordered=True)
319314
320-
facet_wrap = 2
315+
facet_wrap = 2
321316
num_editors = len(df["editor"].unique())
322317
num_rows = (num_editors + facet_wrap - 1) // facet_wrap
323-
row_height = 300
318+
row_height = 300
324319
325320
fig = px.bar(
326321
df,
327322
x="QuarterLabel",
328323
y="count",
329324
facet_col="editor",
330-
facet_row_spacing=0.04,
331-
facet_col_spacing=0.06,
325+
facet_row_spacing=0.04,
326+
facet_col_spacing=0.06,
332327
facet_col_wrap=facet_wrap,
333328
color_discrete_sequence=["indigo"],
334329
labels={"count": "Number of edits"},
@@ -364,6 +359,6 @@ fig.show()
364359

365360
## Row {height=auto}
366361

367-
## Summary
362+
## Summary
368363

369-
This is the end of the dashboard.
364+
This is the end of the dashboard.

0 commit comments

Comments
 (0)