Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: new nicer plots for reporting #95

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions peer-review/current-review-status.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,27 @@ bar_chart = (
bar_chart.show()
```



```{python}
only_active = grouped_status_ct[grouped_status_ct != "Accepted Open"].dropna()

bar_chart = (
alt.Chart(only_active)
.mark_bar(color="purple")
.encode(
x=alt.X("grouped_status:N",
title="Open Reviews", sort="-y",axis=alt.Axis(labelAngle=0)),
y=alt.Y("count:Q", title="Count"),
tooltip=["grouped_status", "count"]
)
).properties(
title="pyOpenSci: Active Review Status", width="container"
)


bar_chart.show()
```
### All open reviews

pyOpenSci currently has **`{python} total_open`** open
Expand Down
137 changes: 129 additions & 8 deletions peer-review/reviews-over-time.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ today = current_date.strftime("%d %B %Y") # Format: YYYY-MM-DD
*Last updated: **`{python} today`***



```{python}
current_dir = Path.cwd()
parent_dir = current_dir.parents[0]
Expand Down Expand Up @@ -112,6 +111,8 @@ presub_open_count = len(presub_count)

```

<div style="margin-bottom: 70px;"></div>

## Total scientific Python software review submissions

```{python}
Expand All @@ -132,15 +133,26 @@ open_count = len(open_reviews)

The plot below shows the volume of all reviews over time.

```{python}

review_status_ct["status"] = review_status_ct["status"].replace({
"seeking editor": "seeking-editor",
"on hold": "on-hold",
"out of scope": "out of-scope"
})


```

```{python}
# TODO: fix this plot so there is enough
# TODO: fix this plot so there is enough space for the labels on the left hand side
chart = (
alt.Chart(review_status_ct)
.mark_bar()
.encode(
y=alt.Y(
"status",
.transform_calculate(status_wrapped="split(datum.status, '-')"
).encode(
x=alt.X(
"status_wrapped:N",
title="",
sort=[
"pre-review",
Expand All @@ -151,8 +163,9 @@ chart = (
"on-hold",
"out-of-scope",
],
axis=alt.Axis(),
),
x=alt.X(
y=alt.Y(
"count",
axis=alt.Axis(tickCount=5),
title="Count",
Expand All @@ -163,14 +176,122 @@ chart = (
alt.Tooltip("count:Q", title="Count"),
],
)
.properties(title="Count of Packages by Status", width="container")
.properties(title="Count of Packages by Status", width="container", height=500)
)


# Display the chart
chart.show()
```

<div style="margin-bottom: 100px;"></div>


### Accepted packages over time


```{python}
accepted_reviews = reviews[reviews["date_accepted"] != "missing"]
accepted_reviews_clean = accepted_reviews[["package_name", "date_accepted"]]
accepted_reviews_clean["date_accepted"] = pd.to_datetime(accepted_reviews_clean["date_accepted"], errors='coerce')
accepted_reviews_clean["year_quarter"] = accepted_reviews_clean["date_accepted"].dt.to_period("Q")
quarterly_accepted_counts = accepted_reviews_clean.groupby("year_quarter").size().reset_index(name="count")
quarterly_accepted_counts["year_quarter"] = quarterly_accepted_counts["year_quarter"].astype(str)

```

```{python}
axis_labels = """datum.label == '2019Q1' ? '2019 Q1' :
datum.label == '2020Q1' ? '2020 Q1' :
datum.label == '2021Q1' ? '2021 Q1' :
datum.label == '2022Q1' ? '2022 Q1' :
datum.label == '2023Q1' ? '2023 Q1' :
datum.label == '2024Q1' ? '2024 Q1' :
'' """
chart = (
alt.Chart(quarterly_accepted_counts)
.mark_bar(color="purple")
.encode(
x=alt.X(
"year_quarter:O",
title="Year-Quarter",
axis=alt.Axis(
labelAngle=0,
labelExpr=axis_labels,
),
),
y=alt.Y(
"count:Q",
title="Number of Accepted Packages per Quarter",
axis=alt.Axis(tickCount=4, tickMinStep=4),
scale=alt.Scale(domain=[0, 8]),
),
tooltip=[
alt.Tooltip("year_quarter:O", title="Quarter"),
alt.Tooltip("count:Q", title="Number of Issues"),
],
)
.properties(
title="Number of Submissions by Quarter per Year",
width="container",
height=400,
)
)

chart.show()
```


```{python}
# semi-annual Values
# TODO: why is year a .0 value?? & why is obspy there?
accepted_reviews_clean["half_year"] = accepted_reviews_clean["date_accepted"].dt.month.map(lambda m: "H1" if m <= 6 else "H2")
accepted_reviews_clean["year"] = accepted_reviews_clean["date_accepted"].dt.year
accepted_reviews_clean = accepted_reviews_clean.sort_values(by="date_accepted")
summary = accepted_reviews_clean.groupby(["year", "half_year"]).size().reset_index(name="count")
```

### Number of packages accepted by year

```{python}
total_accepted_2023_2024 = accepted_reviews_clean.groupby(["year"]).size().reset_index(name="count")
total_accepted_2023_2024["year"] = total_accepted_2023_2024["year"].astype(int)

```

```{python}
chart = (
alt.Chart(total_accepted_2023_2024)
.mark_bar(color="purple", size=80)
.encode(
x=alt.X(
"year:O",
title="Year",
axis=alt.Axis(
labelAngle=0, # Ensure labels are horizontal
labelFontSize=16, # Adjust font size if needed
),
),
y=alt.Y(
"count:Q",
title="Accepted Packages",
scale=alt.Scale(domain=[0, 20]),
axis=alt.Axis(tickCount=5, titlePadding=10),
),
tooltip=[
alt.Tooltip("year:O", title="Year"),
alt.Tooltip("count:Q", title="Total Packages"),
],
)
.properties(
title="Number of Packages Accepted by Year",
width="container",
)
)

chart.show()
```



```{python}
Expand All @@ -188,7 +309,7 @@ status_counts = open_reviews["status"].value_counts().reset_index()

# Total Presubmissions

Here we removed all issues that were help-wanted or issus with our templates that were not related to a software-review submission. As of today we have had
Here we removed all issues that were help-wanted or issus with our templates that were not related to a software-review submission. As of today we have had **`{python} total_presubmissions`** software review presubmission inquiries submitted to pyOpenSci.


# pyOpenSci Peer Review over time
Expand Down
6 changes: 3 additions & 3 deletions pyosmetrics_pkg/src/pyosmetrics/plot_theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def poppins_theme():
return {
"config": {
"title": {
"fontSize": 20,
"fontSize": 26,
"font": "Poppins",
"anchor": "start",
"color": "black",
Expand All @@ -34,8 +34,8 @@ def poppins_theme():
"dx": 10,
},
"axis": {
"labelFontSize": 12,
"titleFontSize": 14,
"labelFontSize": 14,
"titleFontSize": 16,
"titleFont": "Poppins",
"labelFont": "Poppins",
"labelFontSize": 14,
Expand Down
1 change: 1 addition & 0 deletions scripts/get-reviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def process_submissions(submission_type, labels):
"eic": getattr(review.eic, "github_username", None),
"date_opened": review.created_at,
"date_closed": review.closed_at,
"date_accepted": review.date_accepted,
"labels": review.labels,
"issue_num": review.issue_link.split("/")[-1],
"description": review.package_description,
Expand Down