Spaces:
Sleeping
Sleeping
mihaeladuta commited on
Commit ·
02e9842
1
Parent(s): 42078dd
UPdated data and plots.
Browse files- data/ImpactCaseStudies_ppreprocessed.csv.gz +2 -2
- data/Outputs_ppreprocessed.csv.gz +2 -2
- data/ResearchDoctoralDegreesAwarded_ppreprocessed.csv.gz +2 -2
- data/ResearchGroups_ppreprocessed.csv.gz +2 -2
- data/ResearchIncomeInKind_ppreprocessed.csv.gz +2 -2
- data/ResearchIncome_ppreprocessed.csv.gz +2 -2
- data/Results_ppreprocessed.csv.gz +2 -2
- src/Home.py +46 -16
- src/codebook.py +12 -1
- src/pages/1_Outputs_submissions.py +16 -23
- src/visualisations.py +41 -0
data/ImpactCaseStudies_ppreprocessed.csv.gz
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b586fb056ba076ce3861eb2d9e47f6cb09b54b3fdef0484d4f8d7892153b183f
|
| 3 |
+
size 40171812
|
data/Outputs_ppreprocessed.csv.gz
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b1846173be0e2538254eb13b9e9ba68a19aff3fe04b1d5194e95e1d61d2b3b5e
|
| 3 |
+
size 19328565
|
data/ResearchDoctoralDegreesAwarded_ppreprocessed.csv.gz
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eed55027bf8c68c6449c1ab2d3ea2f57f04c4f2d253ce3764bbe177e738bab0d
|
| 3 |
+
size 34634
|
data/ResearchGroups_ppreprocessed.csv.gz
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:579dc85be5a669d80e0fb650d764b58f75e5c389691617360c93d88b2ebf17cf
|
| 3 |
+
size 31879
|
data/ResearchIncomeInKind_ppreprocessed.csv.gz
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ed8a77628d0a75f5d08b0161d499dbc53a923398e55c95cd47c0d51592f649ef
|
| 3 |
+
size 36614
|
data/ResearchIncome_ppreprocessed.csv.gz
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b0620c26cc5fe30f9f118c4e2ac8f8a6a78ebdcc035d7ed1758b46b9207147c9
|
| 3 |
+
size 476153
|
data/Results_ppreprocessed.csv.gz
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:616132569f60c6b3940ecb4ec474cf084e9893ef035706e2b0ba9a4923eb7828
|
| 3 |
+
size 140835
|
src/Home.py
CHANGED
|
@@ -18,23 +18,53 @@ st.sidebar.markdown(f"# {page_sidebar}")
|
|
| 18 |
st.sidebar.success("Select a visualisation from the sidebar to start exploring the data.")
|
| 19 |
|
| 20 |
# page content
|
| 21 |
-
|
| 22 |
st.markdown("## Data source")
|
| 23 |
st.markdown(f"The data used in this app is from the [REF 2021 website]({source_url})"
|
| 24 |
", accessed 2023/08/10.")
|
| 25 |
|
| 26 |
-
st.markdown("## About REF 2021 process")
|
| 27 |
-
|
| 28 |
-
st.markdown("
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
st.
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
st.sidebar.success("Select a visualisation from the sidebar to start exploring the data.")
|
| 19 |
|
| 20 |
# page content
|
| 21 |
+
# ------------
|
| 22 |
st.markdown("## Data source")
|
| 23 |
st.markdown(f"The data used in this app is from the [REF 2021 website]({source_url})"
|
| 24 |
", accessed 2023/08/10.")
|
| 25 |
|
| 26 |
+
st.markdown("## About the REF 2021 process")
|
| 27 |
+
|
| 28 |
+
st.markdown("Submissions consisted of")
|
| 29 |
+
st.markdown("- outputs (e.g. journal articles, books, datasets, etc.)")
|
| 30 |
+
st.markdown("- impact case studies")
|
| 31 |
+
st.markdown("- research groups information")
|
| 32 |
+
st.markdown("- research income information")
|
| 33 |
+
st.markdown("- research environment statements for each institution and unit")
|
| 34 |
+
st.markdown("- doctoral degrees awarded")
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
# MAIN PANELS
|
| 38 |
+
# ------------
|
| 39 |
+
with st.expander("Main panels"):
|
| 40 |
+
dset_to_print = pd.DataFrame.from_dict(cb.PANEL_NAMES,
|
| 41 |
+
orient="index",
|
| 42 |
+
columns=["Main Panel"])
|
| 43 |
+
dset_to_print.index.name = "Code"
|
| 44 |
+
st.dataframe(dset_to_print)
|
| 45 |
+
|
| 46 |
+
# UOAs
|
| 47 |
+
# ----
|
| 48 |
+
with st.expander("Units of assessment (UOA)"):
|
| 49 |
+
dset_to_print = pd.DataFrame.from_dict(cb.UOA_NAMES,
|
| 50 |
+
orient="index",
|
| 51 |
+
columns=["UOA"])
|
| 52 |
+
dset_to_print.index.name = "Code"
|
| 53 |
+
st.dataframe(dset_to_print)
|
| 54 |
+
|
| 55 |
+
# OUTPUT TYPES
|
| 56 |
+
# ------------
|
| 57 |
+
with st.expander("Output types"):
|
| 58 |
+
dset_to_print = pd.DataFrame.from_dict(cb.OUTPUT_TYPE_NAMES,
|
| 59 |
+
orient="index",
|
| 60 |
+
columns=["Output type"])
|
| 61 |
+
dset_to_print.index.name = "Code"
|
| 62 |
+
st.dataframe(dset_to_print)
|
| 63 |
+
|
| 64 |
+
# OPEN ACCESS
|
| 65 |
+
# -----------
|
| 66 |
+
with st.expander("Open access status"):
|
| 67 |
+
st.write(cb.OPEN_ACCESS_NAMES)
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
|
src/codebook.py
CHANGED
|
@@ -45,7 +45,7 @@ COL_RESULTS_1star_BINNED = f"{COL_RESULTS_1star} (binned)"
|
|
| 45 |
COL_RESULTS_UNCLASSIFIED_BINNED = f"{COL_RESULTS_UNCLASSIFIED} (binned)"
|
| 46 |
|
| 47 |
# value to add if no entry in the data
|
| 48 |
-
VALUE_ADDED_NOT_SPECIFIED = 'Not specified
|
| 49 |
|
| 50 |
# source: website
|
| 51 |
PANEL_NAMES = {
|
|
@@ -118,6 +118,17 @@ OUTPUT_TYPE_NAMES = {
|
|
| 118 |
'V': 'Translation'
|
| 119 |
}
|
| 120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
PERCENTAGE_BINS = range(0, 101, 10)
|
| 122 |
|
| 123 |
|
|
|
|
| 45 |
COL_RESULTS_UNCLASSIFIED_BINNED = f"{COL_RESULTS_UNCLASSIFIED} (binned)"
|
| 46 |
|
| 47 |
# value to add if no entry in the data
|
| 48 |
+
VALUE_ADDED_NOT_SPECIFIED = 'Not specified'
|
| 49 |
|
| 50 |
# source: website
|
| 51 |
PANEL_NAMES = {
|
|
|
|
| 118 |
'V': 'Translation'
|
| 119 |
}
|
| 120 |
|
| 121 |
+
OPEN_ACCESS_NAMES = [
|
| 122 |
+
"Access exception",
|
| 123 |
+
"Compliant",
|
| 124 |
+
"Deposit exception",
|
| 125 |
+
"Exception within 3 months of publication",
|
| 126 |
+
"Not compliant",
|
| 127 |
+
"Other exception",
|
| 128 |
+
"Out of scope for open access requirements",
|
| 129 |
+
"Technical exception"
|
| 130 |
+
]
|
| 131 |
+
|
| 132 |
PERCENTAGE_BINS = range(0, 101, 10)
|
| 133 |
|
| 134 |
|
src/pages/1_Outputs_submissions.py
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
import codebook as cb
|
| 4 |
import read_write as rw
|
| 5 |
import process as proc
|
| 6 |
-
import
|
| 7 |
|
| 8 |
|
| 9 |
page_title = "Outputs submissions"
|
|
@@ -14,30 +15,22 @@ st.sidebar.markdown(f"# {page_sidebar}")
|
|
| 14 |
|
| 15 |
(dset, _) = rw.get_data(rw.DATA_PPROC_OUTPUTS)
|
| 16 |
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
for column in [cb.COL_PANEL_NAME,
|
| 20 |
cb.COL_UOA_NAME,
|
| 21 |
cb.COL_OUTPUT_TYPE_NAME,
|
| 22 |
cb.COL_OPEN_ACCESS]:
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
chart = alt.Chart(dset_stats.reset_index())\
|
| 27 |
-
.mark_bar()\
|
| 28 |
-
.encode(
|
| 29 |
-
x=alt.X(column_percent,
|
| 30 |
-
type="quantitative",
|
| 31 |
-
axis=alt.Axis(title=""),
|
| 32 |
-
scale=alt.Scale(domain=[0, 100])
|
| 33 |
-
),
|
| 34 |
-
y=alt.Y(column,
|
| 35 |
-
type="nominal",
|
| 36 |
-
axis=alt.Axis(title="",
|
| 37 |
-
labelLimit=400),
|
| 38 |
-
sort='x'),
|
| 39 |
-
tooltip=[column, column_count, column_percent],
|
| 40 |
-
).properties(
|
| 41 |
-
title=f"{column}: {column_percent}"
|
| 42 |
-
).interactive()
|
| 43 |
-
st.altair_chart(chart, use_container_width=True)
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
import streamlit as st
|
| 3 |
|
| 4 |
import codebook as cb
|
| 5 |
import read_write as rw
|
| 6 |
import process as proc
|
| 7 |
+
import visualisations as vis
|
| 8 |
|
| 9 |
|
| 10 |
page_title = "Outputs submissions"
|
|
|
|
| 15 |
|
| 16 |
(dset, _) = rw.get_data(rw.DATA_PPROC_OUTPUTS)
|
| 17 |
|
| 18 |
+
dset_to_print = pd.DataFrame.from_dict(
|
| 19 |
+
{
|
| 20 |
+
"Submitted outputs": dset.shape[0],
|
| 21 |
+
"Submitting institutions": dset[cb.COL_INST_CODE].nunique()
|
| 22 |
+
},
|
| 23 |
+
orient="index"
|
| 24 |
+
)
|
| 25 |
+
dset_to_print.columns = ["count"]
|
| 26 |
+
st.dataframe(dset_to_print)
|
| 27 |
+
|
| 28 |
+
st.markdown("Select from charts below to view the distribution of outputs submissions.")
|
| 29 |
|
| 30 |
for column in [cb.COL_PANEL_NAME,
|
| 31 |
cb.COL_UOA_NAME,
|
| 32 |
cb.COL_OUTPUT_TYPE_NAME,
|
| 33 |
cb.COL_OPEN_ACCESS]:
|
| 34 |
+
with st.expander(column):
|
| 35 |
+
dset_stats = proc.calculate_counts(dset, column, sort=False)
|
| 36 |
+
vis.draw_counts_percent_chart(dset_stats, column)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/visualisations.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
import streamlit as st
|
| 3 |
+
import altair as alt
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
USE_CONTAINER_WIDTH = True
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def draw_counts_percent_chart(dset,
|
| 10 |
+
column_name,
|
| 11 |
+
column_count="records",
|
| 12 |
+
column_percent="records (%)",
|
| 13 |
+
use_container_width=USE_CONTAINER_WIDTH
|
| 14 |
+
):
|
| 15 |
+
""" Draw a chart with counts and percentages.
|
| 16 |
+
|
| 17 |
+
Args:
|
| 18 |
+
dset (pandas.DataFrame): dataset
|
| 19 |
+
column_name (str): column name
|
| 20 |
+
column_count (str): column name for the counts
|
| 21 |
+
column_percent (str): column name for the percentages
|
| 22 |
+
use_container_width (bool): use container width
|
| 23 |
+
"""
|
| 24 |
+
chart = alt.Chart(dset.reset_index())\
|
| 25 |
+
.mark_bar()\
|
| 26 |
+
.encode(
|
| 27 |
+
x=alt.X(column_percent,
|
| 28 |
+
type="quantitative",
|
| 29 |
+
axis=alt.Axis(title=column_percent),
|
| 30 |
+
scale=alt.Scale(domain=[0, 100])
|
| 31 |
+
),
|
| 32 |
+
y=alt.Y(column_name,
|
| 33 |
+
type="nominal",
|
| 34 |
+
axis=alt.Axis(title="",
|
| 35 |
+
labelLimit=400),
|
| 36 |
+
sort='x'),
|
| 37 |
+
tooltip=[column_name, column_count, column_percent],
|
| 38 |
+
).interactive()
|
| 39 |
+
st.altair_chart(chart,
|
| 40 |
+
use_container_width=USE_CONTAINER_WIDTH)
|
| 41 |
+
|