Skip to content

Commit

Permalink
Added feedback widget, simplified slide cells, removed figsize kwargs…
Browse files Browse the repository at this point in the history
… in plotting cells to improve rendering in book.
  • Loading branch information
nsea-log committed Jul 8, 2024
1 parent 8602055 commit 1c037e1
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {},
"tags": [
"colab"
]
Expand Down Expand Up @@ -89,7 +88,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {},
"tags": []
},
"outputs": [],
Expand All @@ -104,12 +102,37 @@
"from scipy import stats"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# @title Install and import feedback gadget\n",
"\n",
"!pip3 install vibecheck datatops --quiet\n",
"\n",
"from vibecheck import DatatopsContentReviewContainer\n",
"def content_review(notebook_section: str):\n",
" return DatatopsContentReviewContainer(\n",
" \"\", # No text prompt\n",
" notebook_section,\n",
" {\n",
" \"url\": \"https://pmyvdlilci.execute-api.us-east-1.amazonaws.com/klab\",\n",
" \"name\": \"comptools_4clim\",\n",
" \"user_key\": \"l5jpxuee\",\n",
" },\n",
" ).render()\n",
"\n",
"\n",
"feedback_prefix = \"W1D3_T7\""
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"execution": {},
"tags": []
},
"outputs": [],
Expand All @@ -127,8 +150,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"execution": {}
"cellView": "form"
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -158,7 +180,6 @@
"execution_count": null,
"metadata": {
"cellView": "form",
"execution": {},
"tags": []
},
"outputs": [],
Expand Down Expand Up @@ -221,12 +242,21 @@
"display(tabs)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# @title Submit your feedback\n",
"content_review(f\"{feedback_prefix}_Impact_of_Climate_Variability_Video\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"execution": {},
"pycharm": {
"name": "#%%\n"
},
Expand All @@ -242,14 +272,18 @@
"\n",
"link_id = \"tyjwu\"\n",
"\n",
"download_link = f\"https://osf.io/download/{link_id}/\"\n",
"render_link = f\"https://mfr.ca-1.osf.io/render?url=https://osf.io/{link_id}/?direct%26mode=render%26action=download%26mode=render\"\n",
"# @markdown\n",
"out = widgets.Output()\n",
"with out:\n",
" print(f\"If you want to download the slides: {download_link}\")\n",
" display(IFrame(src=f\"{render_link}\", width=730, height=410))\n",
"display(out)"
"print(f\"If you want to download the slides: https://osf.io/download/{link_id}/\")\n",
"IFrame(src=f\"https://mfr.ca-1.osf.io/render?url=https://osf.io/{link_id}/?direct%26mode=render%26action=download%26mode=render\", width=854, height=480)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# @title Submit your feedback\n",
"content_review(f\"{feedback_prefix}_Impact_of_Climate_Variability_Slides\")"
]
},
{
Expand Down Expand Up @@ -287,7 +321,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {},
"tags": []
},
"outputs": [],
Expand All @@ -304,7 +337,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {},
"tags": []
},
"outputs": [],
Expand Down Expand Up @@ -337,7 +369,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {},
"tags": []
},
"outputs": [],
Expand All @@ -353,7 +384,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {},
"tags": []
},
"outputs": [],
Expand Down Expand Up @@ -396,7 +426,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {},
"tags": []
},
"outputs": [],
Expand Down Expand Up @@ -461,7 +490,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {},
"tags": []
},
"outputs": [],
Expand All @@ -479,7 +507,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {},
"tags": []
},
"outputs": [],
Expand All @@ -495,7 +522,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {},
"tags": []
},
"outputs": [],
Expand Down Expand Up @@ -530,7 +556,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {},
"tags": []
},
"outputs": [],
Expand Down Expand Up @@ -589,7 +614,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {},
"tags": []
},
"outputs": [],
Expand All @@ -607,7 +631,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {},
"tags": []
},
"outputs": [],
Expand Down Expand Up @@ -656,7 +679,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {},
"tags": []
},
"outputs": [],
Expand Down Expand Up @@ -688,7 +710,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {},
"tags": []
},
"outputs": [],
Expand All @@ -701,6 +722,16 @@
"\"\"\""
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# @title Submit your feedback\n",
"content_review(f\"{feedback_prefix}_Questions_2\")"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand All @@ -716,7 +747,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {},
"tags": []
},
"outputs": [],
Expand Down Expand Up @@ -784,7 +814,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {},
"tags": []
},
"outputs": [],
Expand Down Expand Up @@ -855,6 +884,16 @@
"ax.set_ylabel(\"Precipitation Anomaly\\n(mm/day)\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# @title Submit your feedback\n",
"content_review(f\"{feedback_prefix}_Coding_Exercise_2\")"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down Expand Up @@ -916,7 +955,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.19"
"version": "3.9.18"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 1c037e1

Please sign in to comment.