Spaces:
Sleeping
Sleeping
osanseviero
commited on
Commit
•
56ea52e
1
Parent(s):
7f99a61
Add likes
Browse files- changelog.md +5 -0
- models.py +35 -3
changelog.md
CHANGED
@@ -3,6 +3,11 @@ Changelog
|
|
3 |
Planned
|
4 |
- Allow filtering just for the new models (no way to get this atm)
|
5 |
|
|
|
|
|
|
|
|
|
|
|
6 |
v0.2 - Oct 24
|
7 |
- Languages
|
8 |
- Allow filtering for modality
|
|
|
3 |
Planned
|
4 |
- Allow filtering just for the new models (no way to get this atm)
|
5 |
|
6 |
+
v0.3 - Nov 25
|
7 |
+
- Rename Social Features tab
|
8 |
+
- Add chart of number of likes
|
9 |
+
- Add chart of rate of change for likes
|
10 |
+
|
11 |
v0.2 - Oct 24
|
12 |
- Languages
|
13 |
- Allow filtering for modality
|
models.py
CHANGED
@@ -55,7 +55,7 @@ def main():
|
|
55 |
|
56 |
tab = st.selectbox(
|
57 |
'Topic of interest',
|
58 |
-
["Language","License", "Pipeline", "
|
59 |
|
60 |
if tab == "Language":
|
61 |
st.header("Languages info")
|
@@ -462,8 +462,8 @@ def main():
|
|
462 |
|
463 |
|
464 |
#with tab4:
|
465 |
-
if tab == "
|
466 |
-
st.header("
|
467 |
|
468 |
columns_of_interest = ["prs_count", "prs_open", "prs_merged", "prs_closed", "discussions_count", "discussions_open", "discussions_closed"]
|
469 |
sums = data[columns_of_interest].sum()
|
@@ -513,9 +513,41 @@ def main():
|
|
513 |
curr_change, delta = change_and_delta(sums_old_old["discussions_closed"], sums_old["discussions_closed"], sums["discussions_closed"])
|
514 |
st.metric(label="Discussions closed change", value=curr_change,delta=delta)
|
515 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
516 |
filtered_data = data[["repo_id", "prs_count", "prs_open", "prs_merged", "prs_closed", "discussions_count", "discussions_open", "discussions_closed"]].sort_values("prs_count", ascending=False).reset_index(drop=True)
|
517 |
st.dataframe(filtered_data)
|
518 |
|
|
|
519 |
#with tab5:
|
520 |
if tab == "Libraries":
|
521 |
st.header("Library info")
|
|
|
55 |
|
56 |
tab = st.selectbox(
|
57 |
'Topic of interest',
|
58 |
+
["Language","License", "Pipeline", "Social Features", "Libraries", "Model Cards", "Super Users", "Raw Data"])
|
59 |
|
60 |
if tab == "Language":
|
61 |
st.header("Languages info")
|
|
|
462 |
|
463 |
|
464 |
#with tab4:
|
465 |
+
if tab == "Social Features":
|
466 |
+
st.header("Social Features")
|
467 |
|
468 |
columns_of_interest = ["prs_count", "prs_open", "prs_merged", "prs_closed", "discussions_count", "discussions_open", "discussions_closed"]
|
469 |
sums = data[columns_of_interest].sum()
|
|
|
513 |
curr_change, delta = change_and_delta(sums_old_old["discussions_closed"], sums_old["discussions_closed"], sums["discussions_closed"])
|
514 |
st.metric(label="Discussions closed change", value=curr_change,delta=delta)
|
515 |
|
516 |
+
likes = []
|
517 |
+
for r in supported_revisions:
|
518 |
+
likes.append(process_dataset(r)["likes"].sum())
|
519 |
+
|
520 |
+
source = pd.DataFrame({
|
521 |
+
'revision': supported_revisions[::-1],
|
522 |
+
'likes': likes[::-1],
|
523 |
+
})
|
524 |
+
|
525 |
+
st.subheader("Total likes")
|
526 |
+
st.write(alt.Chart(source).mark_bar().encode(
|
527 |
+
x=alt.X('revision', sort=alt.EncodingSortField(field="revision", op="count", order='ascending')),
|
528 |
+
y='likes'
|
529 |
+
))
|
530 |
+
|
531 |
+
st.subheader("Likes Rate of Change")
|
532 |
+
diffs = source["likes"].pct_change()
|
533 |
+
source = pd.DataFrame({
|
534 |
+
'revision': supported_revisions[::-1][1:],
|
535 |
+
'likes_change': diffs[1:],
|
536 |
+
})
|
537 |
+
|
538 |
+
print(source[["revision", "likes_change"]])
|
539 |
+
st.write(alt.Chart(source).mark_bar().encode(
|
540 |
+
x=alt.X('revision', sort=alt.EncodingSortField(field="revision", op="count", order='ascending')),
|
541 |
+
y='likes_change'
|
542 |
+
))
|
543 |
+
|
544 |
+
|
545 |
+
|
546 |
+
st.subheader("Raw Data")
|
547 |
filtered_data = data[["repo_id", "prs_count", "prs_open", "prs_merged", "prs_closed", "discussions_count", "discussions_open", "discussions_closed"]].sort_values("prs_count", ascending=False).reset_index(drop=True)
|
548 |
st.dataframe(filtered_data)
|
549 |
|
550 |
+
|
551 |
#with tab5:
|
552 |
if tab == "Libraries":
|
553 |
st.header("Library info")
|