Skip to content

Commit 90339b4

Browse files
Merge pull request #263 from coding-for-reproducible-research/intro_to_julia_installation_instructions
Add Intro to julia installation
2 parents 4d50461 + 2d556e0 commit 90339b4

File tree

1 file changed

+262
-1
lines changed

1 file changed

+262
-1
lines changed

programme_information/intro_to_julia.ipynb

Lines changed: 262 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,268 @@
1313
"source": [
1414
"# Introduction to Julia\n",
1515
"\n",
16-
"This course is currently under development. "
16+
"## Course Description\n",
17+
"Welcome to the Introduction to Julia course! This course has been created to give you an idea of Julia's particular language features. It assumes you are already comfortable with the basics of programming, allowing for more detailed and interesting topics to be discussed. To be able to best engage with this course, it is therefore recommended that you are familiar with the content in both \"Introduction to Python\" and \"Python for Data Analysis\".\n",
18+
"\n",
19+
"## Course Objectives\n",
20+
"- Understand Julia’s design philosophy and interact fluently with its REPL, including both the package and help modes.\n",
21+
"- Define and manipulate basic data types and variables, and apply control-flow constructs (`if`, `for`, `while`) to express algorithmic logic. \n",
22+
"- Encapsulate functionality in Julia functions, leveraging multiple dispatch to write clean, type-specific methods. \n",
23+
"- Work with arrays and matrices, perform element-wise and linear algebra operations, and harness Julia’s native array abstractions for efficient numerical computing. \n",
24+
"- Read from and write to external data sources using Julia’s I/O facilities, and parse or format data in common file formats. \n",
25+
"- Create informative visualisations of data and simulation output with `Plots.jl` (and other graphics packages). \n",
26+
"- Manage project dependencies and packages using Julia’s built-in package manager (`Pkg`), and organise your code into multi-file, reproducible projects. \n",
27+
"- Diagnose and eliminate performance bottlenecks by profiling your code.\n",
28+
"- Apply your skills to a capstone project, implementing and optimizing Conway’s Game of Life from first principles, and extending it with custom rules, GUIs, or advanced visualizations.\n",
29+
"\n",
30+
"## Pre-requisite Knowledge\n",
31+
"\n",
32+
"This course assumes prior programming experience and a comfort with fundamental programming concepts (variables, if statements, for/while loops, functions, errors), as gained from programming in another language. The course is not designed as a course for learning your first programming language.\n",
33+
"\n",
34+
"## Sign-up \n",
35+
"\n",
36+
"To check for upcoming course dates and to register, please visit the Workshop Schedule and Sign-up page available [here](../cfrr_program_details/courses_overview.ipynb)."
37+
]
38+
},
39+
{
40+
"cell_type": "code",
41+
"execution_count": 1,
42+
"id": "ed784f7a-cb16-4595-bc34-9fad10e2310b",
43+
"metadata": {
44+
"editable": true,
45+
"slideshow": {
46+
"slide_type": ""
47+
},
48+
"tags": [
49+
"remove-input"
50+
]
51+
},
52+
"outputs": [
53+
{
54+
"data": {
55+
"text/html": [
56+
"<div style='font-weight: bold;'>This course is currently accepting applications.</div>"
57+
],
58+
"text/plain": [
59+
"<IPython.core.display.HTML object>"
60+
]
61+
},
62+
"metadata": {},
63+
"output_type": "display_data"
64+
}
65+
],
66+
"source": [
67+
"import pandas as pd\n",
68+
"from datetime import datetime\n",
69+
"from IPython.display import display, HTML\n",
70+
"\n",
71+
"# Define the course that is being looked at\n",
72+
"course_name = \"Introduction to Julia\"\n",
73+
"\n",
74+
"# Load the CSV file\n",
75+
"file_path = '../data/workshop_info.csv' # Adjust the path to your file location\n",
76+
"courses_df = pd.read_csv(file_path)\n",
77+
"\n",
78+
"# Strip any extra spaces in the column names\n",
79+
"courses_df.columns = courses_df.columns.str.strip()\n",
80+
"\n",
81+
"# Convert date columns to datetime\n",
82+
"courses_df['Start Date'] = pd.to_datetime(courses_df['Start Date'], dayfirst=True, errors='coerce')\n",
83+
"courses_df['End Date'] = pd.to_datetime(courses_df['End Date'], dayfirst=True, errors='coerce')\n",
84+
"\n",
85+
"# Get today's date\n",
86+
"today = datetime.now()\n",
87+
"\n",
88+
"# Function to generate markdown text based on the course dates\n",
89+
"def generate_html(row):\n",
90+
" if pd.notna(row['Start Date']) and pd.notna(row['End Date']):\n",
91+
" if row['Start Date'] <= today <= row['End Date']:\n",
92+
" return f\"<div style='font-weight: bold;'>This course is currently accepting applications.</div>\"\n",
93+
" return \"\"\n",
94+
"\n",
95+
"# Apply the function and create a new column for Markdown\n",
96+
"courses_df['HTML'] = courses_df.apply(generate_html, axis=1)\n",
97+
"\n",
98+
"# Variable for course name\n",
99+
"\n",
100+
"\n",
101+
"# Filter the DataFrame for the given course name and display the HTML text\n",
102+
"html_output = courses_df[courses_df['Course Name'] == course_name]['HTML'].values[0]\n",
103+
"display(HTML(html_output))\n"
104+
]
105+
},
106+
{
107+
"cell_type": "markdown",
108+
"id": "7d378ec2-28e2-4d30-b588-22b3273fec59",
109+
"metadata": {
110+
"editable": true,
111+
"slideshow": {
112+
"slide_type": ""
113+
},
114+
"tags": []
115+
},
116+
"source": [
117+
"## Installation Guide \n",
118+
"All CfRR courses require attendees to use their own computer/laptop to follow workshop activities and take effective notes. \n",
119+
"\n",
120+
"If you are new to Julia then the recomened method of using Julia for this course is with JupyterLab. You can follow the instructions within [Introduction to Python](intro_to_python.ipynb) to install JupyterLab.\n",
121+
"\n",
122+
"To install Julia on your laptop, you will want to follow the commands below, depending on what OS you are using. \n",
123+
"\n",
124+
"## Installation Guide \n",
125+
"All CfRR courses require attendees to use their own computer/laptop to follow workshop activities and take effective notes. \n",
126+
"\n",
127+
"Follow the steps below for your platform to get Julia up and running. The best way to install and manage Julia on your system is via the official `juliaup` tool. \n",
128+
"\n",
129+
"### Install Julia\n",
130+
"\n",
131+
"#### Windows\n",
132+
"Install Julia by running this in the command prompt:\n",
133+
"```\n",
134+
"winget install --name Julia --id 9NJNWW8PVKMN -e -s msstore\n",
135+
"```\n",
136+
"\n",
137+
"#### macOS and Linux\n",
138+
"Install Julia by running this in the terminal: \n",
139+
"\n",
140+
"```\n",
141+
"curl -fsSL https://install.julialang.org | sh\n",
142+
"```\n",
143+
"\n",
144+
"These commands will fetch and install `juliaup`, then download the current stable Julia release.\n",
145+
"\n",
146+
"### Verify your installation\n",
147+
"After installation completes, close and reopen your terminal (or PowerShell), then check:\n",
148+
"\n",
149+
"```\n",
150+
"juliaup status\n",
151+
"julia --version\n",
152+
"```\n",
153+
"\n",
154+
"Where you should see the version of Julia that has been installed printed. \n",
155+
"\n",
156+
"## Adding a Julia Kernel to JupyterLab \n",
157+
"**Add Julia to JupyterLab**\n",
158+
" - Within the Julia REPL, run the following command to add Julia as a kernel to JupyterLab, replacing `<Your Julia Version>` with the version returned when you run `julia --version`. \n",
159+
" - Command: 'import Pkg; Pkg.add(\"IJulia\"); Pkg.build(\"IJulia\"); using IJulia; installkernel(\"Julia <Your Julia Version>\")'\n",
160+
" - You can enter the Julia REPL by entering `julia` on your terminal / command line / PowerSheel etc.\n",
161+
"\n",
162+
"You should now see `Julia` available alongside Python in the top-right kernel picker, as per the screenshot below: \n",
163+
"\n",
164+
"![JupyterLab With Julia Kernel](images/JupyterLabWithJulia.png)\n",
165+
"\n",
166+
"\n",
167+
"## Self Study Material Link \n",
168+
"The self-study material for this course is available [here](../individual_modules/section_landing_pages/introduction_to_julia.md).\n",
169+
"\n",
170+
"## Developers\n",
171+
"\n",
172+
"This course was developed by Liam Berrisford and Tom Hawes. This course is based on the official [Julia documentation](https://docs.julialang.org/en/v1/).\n",
173+
"\n",
174+
"## License Info "
175+
]
176+
},
177+
{
178+
"cell_type": "code",
179+
"execution_count": 2,
180+
"id": "64a0e3a8-e122-4e4c-8c74-20df65523e38",
181+
"metadata": {
182+
"editable": true,
183+
"slideshow": {
184+
"slide_type": ""
185+
},
186+
"tags": [
187+
"remove-input"
188+
]
189+
},
190+
"outputs": [
191+
{
192+
"data": {
193+
"text/markdown": [
194+
"### Instructional Material\n",
195+
"\n",
196+
"The instructional material in this course is copyright © 2024 University of Exeter\n",
197+
"and is made available under the Creative Commons Attribution 4.0 International\n",
198+
"licence (https://creativecommons.org/licenses/by/4.0/). Instructional material\n",
199+
"consists of material that is contained within the \"individual_modules/introduction_to_hpc\" folders in\n",
200+
"this repository, with the exception of code snippets and example programs found\n",
201+
"in files within these folders. Such code snippets and example programs are\n",
202+
"considered software for the purposes of this licence. \n",
203+
"\n",
204+
"\n",
205+
"### Software\n",
206+
"\n",
207+
"Except where otherwise noted, software provided in this repository is made\n",
208+
"available under the MIT licence (https://opensource.org/licenses/MIT).\n",
209+
"\n",
210+
"Copyright © 2024 University of Exeter\n",
211+
"\n",
212+
"Permission is hereby granted, free of charge, to any person obtaining a copy\n",
213+
"of this software and associated documentation files (the \"Software\"), to deal\n",
214+
"in the Software without restriction, including without limitation the rights\n",
215+
"to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n",
216+
"copies of the Software, and to permit persons to whom the Software is\n",
217+
"furnished to do so, subject to the following conditions:\n",
218+
"\n",
219+
"The above copyright notice and this permission notice shall be included in all\n",
220+
"copies or substantial portions of the Software.\n",
221+
"\n",
222+
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n",
223+
"IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n",
224+
"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n",
225+
"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n",
226+
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n",
227+
"OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n",
228+
"SOFTWARE.\n",
229+
"\n",
230+
"The software in this repository is adapted from software that is covered by the\n",
231+
"following copyright and permission notice:\n",
232+
"\n",
233+
" Copyright © 2024 Software Carpentry\n",
234+
"\n",
235+
" Permission is hereby granted, free of charge, to any person obtaining\n",
236+
" a copy of this software and associated documentation files (the\n",
237+
" \"Software\"), to deal in the Software without restriction, including\n",
238+
" without limitation the rights to use, copy, modify, merge, publish,\n",
239+
" distribute, sublicense, and/or sell copies of the Software, and to\n",
240+
" permit persons to whom the Software is furnished to do so, subject to\n",
241+
" the following conditions:\n",
242+
"\n",
243+
" The above copyright notice and this permission notice shall be\n",
244+
" included in all copies or substantial portions of the Software.\n",
245+
"\n",
246+
" THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n",
247+
" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n",
248+
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n",
249+
" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n",
250+
" LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n",
251+
" OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n",
252+
" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
253+
],
254+
"text/plain": [
255+
"<IPython.core.display.Markdown object>"
256+
]
257+
},
258+
"metadata": {},
259+
"output_type": "display_data"
260+
}
261+
],
262+
"source": [
263+
"from IPython.display import Markdown, display\n",
264+
"\n",
265+
"def display_markdown(file_path):\n",
266+
" try:\n",
267+
" with open(file_path, 'r') as file:\n",
268+
" content = file.read()\n",
269+
" display(Markdown(content))\n",
270+
" except FileNotFoundError:\n",
271+
" print(f\"The file {file_path} was not found.\")\n",
272+
" except Exception as e:\n",
273+
" print(f\"An error occurred: {e}\")\n",
274+
"\n",
275+
"# Example usage:\n",
276+
"file_path = '../individual_modules/introduction_to_hpc/LICENSE.txt' # Replace with your file path\n",
277+
"display_markdown(file_path)"
17278
]
18279
},
19280
{

0 commit comments

Comments
 (0)