Skip to content

Commit 93148f1

Browse files
Automate workshop schedule and signup
1 parent ea37950 commit 93148f1

16 files changed

+91
-38
lines changed

cfrr_program_details/courses_overview.ipynb

Lines changed: 64 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,76 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "e18ae98b-39e0-4d7b-bbf4-1114ffeef96c",
5+
"id": "02b9e8f5-82ed-460b-af25-9034e538b7b3",
66
"metadata": {},
77
"source": [
8-
"# Workshop Schedule and Signup\n",
9-
"\n",
10-
"- Introduction to R: 8th/15th/22nd October 1-4pm (online only). [MS Form Signup](https://forms.office.com/Pages/ResponsePage.aspx?id=d10qkZj77k6vMhM02PBKU-3R4SvRoClNrKjEX5qG1X1UQjJCSzFWQjNVSldGRFhDUDNXVjdBQjNZSi4u)\n",
11-
"- Introduction to Python: 23rd/30th October 10am-1pm (online only) - [MS Form Signup](https://forms.office.com/Pages/ResponsePage.aspx?id=d10qkZj77k6vMhM02PBKU-3R4SvRoClNrKjEX5qG1X1UNDJFN1NaRlk0UkpLNjVDSTM2TlM0NlpPWS4u)\n",
12-
"- Regression Analysis with R: 25th October 10am-1pm (online only) - [MS Form Signup](https://forms.office.com/Pages/ResponsePage.aspx?id=d10qkZj77k6vMhM02PBKU-3R4SvRoClNrKjEX5qG1X1UMU1KRUpEOFRJQjFEOVVUVzFDMTRQMFZLRi4u)"
8+
"# Workshop Schedule and Signup"
139
]
1410
},
1511
{
1612
"cell_type": "code",
17-
"execution_count": null,
18-
"id": "9f182a12-b6bf-4a95-b4c4-92c08951d8a1",
19-
"metadata": {},
20-
"outputs": [],
21-
"source": []
13+
"execution_count": 6,
14+
"id": "d3aa7606-0f50-4f05-b104-ad4521c80406",
15+
"metadata": {
16+
"editable": true,
17+
"slideshow": {
18+
"slide_type": ""
19+
},
20+
"tags": [
21+
"remove-input"
22+
]
23+
},
24+
"outputs": [
25+
{
26+
"data": {
27+
"text/markdown": [
28+
"- Introduction to Python: 23rd/30th October 10am-1pm (online only) - [MS Form Signup](https://forms.office.com/Pages/ResponsePage.aspx?id=d10qkZj77k6vMhM02PBKU-3R4SvRoClNrKjEX5qG1X1UNDJFN1NaRlk0UkpLNjVDSTM2TlM0NlpPWS4u)\n",
29+
"- Introduction to R: 8th/15th/22nd October 1-4pm (online only) - [MS Form Signup](https://forms.office.com/Pages/ResponsePage.aspx?id=d10qkZj77k6vMhM02PBKU-3R4SvRoClNrKjEX5qG1X1UQjJCSzFWQjNVSldGRFhDUDNXVjdBQjNZSi4u)\n",
30+
"- Regression Analysis with R: 25th October 10am-1pm (online only) - [MS Form Signup](https://forms.office.com/Pages/ResponsePage.aspx?id=d10qkZj77k6vMhM02PBKU-3R4SvRoClNrKjEX5qG1X1UMU1KRUpEOFRJQjFEOVVUVzFDMTRQMFZLRi4u)"
31+
],
32+
"text/plain": [
33+
"<IPython.core.display.Markdown object>"
34+
]
35+
},
36+
"metadata": {},
37+
"output_type": "display_data"
38+
}
39+
],
40+
"source": [
41+
"import pandas as pd\n",
42+
"from IPython.display import Markdown, display\n",
43+
"from datetime import datetime\n",
44+
"\n",
45+
"# Load the CSV file (adjust the file path as needed)\n",
46+
"file_path = '../data/workshop_info.csv'\n",
47+
"courses_df = pd.read_csv(file_path)\n",
48+
"\n",
49+
"# Strip any extra spaces in the column names\n",
50+
"courses_df.columns = courses_df.columns.str.strip()\n",
51+
"\n",
52+
"# Convert the 'End Date' column to datetime (assuming the date format is day-first)\n",
53+
"courses_df['End Date'] = pd.to_datetime(courses_df['End Date'], dayfirst=True, errors='coerce')\n",
54+
"\n",
55+
"# Get today's date\n",
56+
"today = datetime.now()\n",
57+
"\n",
58+
"# Filter for rows that contain valid MS Form Signup links, Course Date information, and check if the 'End Date' is still valid\n",
59+
"filtered_courses_df = courses_df.dropna(subset=['Course Date', 'MS Form Signup'])\n",
60+
"filtered_courses_df = filtered_courses_df[filtered_courses_df['End Date'] > today]\n",
61+
"\n",
62+
"# Function to generate markdown text based on course details\n",
63+
"def generate_markdown(row):\n",
64+
" return f\"- {row['Course Name']}: {row['Course Date']} - [MS Form Signup]({row['MS Form Signup']})\"\n",
65+
"\n",
66+
"# Apply the function and create the markdown output\n",
67+
"markdown_output = filtered_courses_df.apply(generate_markdown, axis=1).tolist()\n",
68+
"\n",
69+
"# Join the markdown lines into a single block\n",
70+
"markdown_text = \"\\n\".join(markdown_output)\n",
71+
"\n",
72+
"# Display the markdown text in rendered form\n",
73+
"display(Markdown(markdown_text))"
74+
]
2275
}
2376
],
2477
"metadata": {

data/accepting_applications.csv

Lines changed: 0 additions & 14 deletions
This file was deleted.

data/workshop_info.csv

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Course Name,Start Date,End Date ,Course Date,MS Form Signup
2+
Introduction to Python,18/09/2024,16/10/2024,23rd/30th October 10am-1pm (online only),https://forms.office.com/Pages/ResponsePage.aspx?id=d10qkZj77k6vMhM02PBKU-3R4SvRoClNrKjEX5qG1X1UNDJFN1NaRlk0UkpLNjVDSTM2TlM0NlpPWS4u
3+
Python for Data Analysis,,,,
4+
Introduction to R,18/09/2024,01/10/2024,8th/15th/22nd October 1-4pm (online only),https://forms.office.com/Pages/ResponsePage.aspx?id=d10qkZj77k6vMhM02PBKU-3R4SvRoClNrKjEX5qG1X1UQjJCSzFWQjNVSldGRFhDUDNXVjdBQjNZSi4u
5+
Regression Analysis with R,18/09/2024,18/10/2024,25th October 10am-1pm (online only),https://forms.office.com/Pages/ResponsePage.aspx?id=d10qkZj77k6vMhM02PBKU-3R4SvRoClNrKjEX5qG1X1UMU1KRUpEOFRJQjFEOVVUVzFDMTRQMFZLRi4u
6+
Advanced Regression Analysis with R,,,,
7+
Working with Data in R,,,,
8+
Introduction to HPC,,,,
9+
Introduction to Version Control,,,,
10+
Intermediate Version Control,,,,
11+
Introduction to Unix,,,,
12+
Computational Thinking,,,,
13+
Software Development Best Practice,,,,
14+
Introduction to Julia,,,,

programme_information/advanced_regression_analysis_with_r.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"course_name = \"Advanced Regression Analysis with R\"\n",
8080
"\n",
8181
"# Load the CSV file\n",
82-
"file_path = '../data/accepting_applications.csv' # Adjust the path to your file location\n",
82+
"file_path = '../data/workshop_info.csv' # Adjust the path to your file location\n",
8383
"courses_df = pd.read_csv(file_path)\n",
8484
"\n",
8585
"# Strip any extra spaces in the column names\n",

programme_information/computational_thinking.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"course_name = \"Computational Thinking\"\n",
5555
"\n",
5656
"# Load the CSV file\n",
57-
"file_path = '../data/accepting_applications.csv' # Adjust the path to your file location\n",
57+
"file_path = '../data/workshop_info.csv' # Adjust the path to your file location\n",
5858
"courses_df = pd.read_csv(file_path)\n",
5959
"\n",
6060
"# Strip any extra spaces in the column names\n",

programme_information/intermediate_version_control.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"course_name = \"Intermediate Version Control\"\n",
5858
"\n",
5959
"# Load the CSV file\n",
60-
"file_path = '../data/accepting_applications.csv' # Adjust the path to your file location\n",
60+
"file_path = '../data/workshop_info.csv' # Adjust the path to your file location\n",
6161
"courses_df = pd.read_csv(file_path)\n",
6262
"\n",
6363
"# Strip any extra spaces in the column names\n",

programme_information/intro_to_hpc.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"course_name = \"Introduction to HPC\"\n",
5959
"\n",
6060
"# Load the CSV file\n",
61-
"file_path = '../data/accepting_applications.csv' # Adjust the path to your file location\n",
61+
"file_path = '../data/workshop_info.csv' # Adjust the path to your file location\n",
6262
"courses_df = pd.read_csv(file_path)\n",
6363
"\n",
6464
"# Strip any extra spaces in the column names\n",

programme_information/intro_to_julia.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"course_name = \"Introduction to Julia\"\n",
5656
"\n",
5757
"# Load the CSV file\n",
58-
"file_path = '../data/accepting_applications.csv' # Adjust the path to your file location\n",
58+
"file_path = '../data/workshop_info.csv' # Adjust the path to your file location\n",
5959
"courses_df = pd.read_csv(file_path)\n",
6060
"\n",
6161
"# Strip any extra spaces in the column names\n",

programme_information/intro_to_python.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"course_name = \"Introduction to Python\"\n",
7070
"\n",
7171
"# Load the CSV file\n",
72-
"file_path = '../data/accepting_applications.csv' # Adjust the path to your file location\n",
72+
"file_path = '../data/workshop_info.csv' # Adjust the path to your file location\n",
7373
"courses_df = pd.read_csv(file_path)\n",
7474
"\n",
7575
"# Strip any extra spaces in the column names\n",

programme_information/intro_to_r.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"course_name = \"Introduction to R\"\n",
6767
"\n",
6868
"# Load the CSV file\n",
69-
"file_path = '../data/accepting_applications.csv' # Adjust the path to your file location\n",
69+
"file_path = '../data/workshop_info.csv' # Adjust the path to your file location\n",
7070
"courses_df = pd.read_csv(file_path)\n",
7171
"\n",
7272
"# Strip any extra spaces in the column names\n",

0 commit comments

Comments
 (0)