- 1
-
This is a code annotation.
using
is the keyword we say in Julia to add a package, in this caseCairoMakie
Lab 1: Setup & Hello World
Julia Installation, GitHub Classroom Workflow, and Quarto Basics
Welcome to Lab 1! This is our first hands-on session where we’ll set up and test all the essential tools you’ll be using throughout the course. Think of this as building your computational toolkit - we’ll install Julia, VS Code, Quarto, and GitHub tools, then create a simple but meaningful plot to make sure everything is working correctly. By the end of this lab, you’ll have a fully functional development environment and will have completed your first reproducible analysis workflow. Don’t worry if some of these tools are new to you - we’ll walk through everything step by step, and this foundation will make all future assignments much smoother!
1 Do Before Lab
Install this software before the lab date so that we can focus in lab on troubleshooting and building understanding.
This lab assumes some elementary knowledge of the command line. If you’re a novice, the best place to learn about the command line is the Software Carpentries Lesson on The Unix Shell.
- Install Julia, VS Code, Quarto, GitHub Desktop and the Julia / Quarto VS Code extensions following the instructions on the textbook website. You can read more about installation and background on that page. Note that if you are an experienced user of other IDEs or git interfaces, VS Code and GitHub Desktop are not strictly required.
- Create a single folder on your computer to hold all of your CEVE 543 labs. This should be a folder on your computer that is not synced with Google Drive, Microsoft SharePoint, etc.
- Create a GitHub account. If you already have a GitHub account, you can use that for this course and do not need to create a new account. Otherwise, create an account. It doesn’t have to be linked to your Rice email or your NetID.
- Get GitHub Copilot. As a student, you can get GitHub Copilot for free by following the instructions at https://github.com/education/students by clicking “Join GitHub education”.
2 Do During Lab
- Open this repository in GitHub classroom. For labs and problem sets, you should use the GitHub Classroom link posted on Canvas to “accept” the assignment, which will give you your own GitHub repository for that assignment. The first time you click one of these links, you will need to link your place on the course roster with your GitHub account.
- Clone your repository to your computer. See the instructions on the textbook website for background on what cloning is. The easiest way to clone is using GitHub Desktop.
- Open the Repository in VS Code. You can do this directly from VS Code. You can also do this from your command line.
- Activate and instantiate the environment. In VS Code, open the terminal and run
julia --project=.
to start Julia with the project environment. Then runusing Pkg; Pkg.instantiate()
to install all required packages for this lab. - Modify code. You need to make two edits: (1) Replace “CEVE 543 Fall 2025” with your name in the author field at the top of the document, and (2) modify the
my_netid
variable in the code section below to use your actual NetID instead of the placeholder “jd82”. - Preview. In VS Code, open the Command Palette (Cmd+Shift+P on Mac, Ctrl+Shift+P on Windows/Linux) and run “Quarto: Preview” to preview your document in a web browser. This will show you how your document looks and execute the Julia code.
- Push to GitHub. Save your changes and commit them using GitHub Desktop or the command line (
git add .
,git commit -m "Complete lab 1"
,git push
). This uploads your completed work to your GitHub repository. - Pull any automated pull requests. This course uses BlueStyle for Julia code formatting, which is automatically applied via JuliaFormatter.jl. This will make your code cleaner and more readable. To avoid this, run
using JuliaFormatter; format("."; style=BlueStyle())
in the REPL. If any changes are automatically applied,pull
them to your computer. - Render to PDF. Once you’re satisfied with your preview, render the document to PDF using “Quarto: Render PDF” from the Command Palette, or run
quarto render index.qmd --to typst
in the terminal. Typst is a modern typesetting system that creates beautiful PDFs with much faster rendering than LaTeX. - Submit PDF to Canvas. Upload the generated PDF file to the corresponding Canvas assignment. Make sure the PDF contains your NetID and the completed plot showing the noisy sine wave measurements and true function.
You will follow this general workflow (GitHub classroom ➡️ clone and open ➡️ activate and instantiate ➡️ code ➡️ preview and render ➡️ push) for future assignments as well.
3 Code
We will create a basic plot from the tutorial. This will verify that your installation is running and working correctly.
Do not change this
x = range(0, 10; length=100)
y_true = sin.(x)
# Add noise to create measurements
noise = 0.2 * randn(length(x))
y_measurements = y_true .+ noise
f = Figure()
ax = Axis(f[1, 1]; title="Plot of y = sin(x) by $(my_netid)", xlabel=L"$x$", ylabel=L"$y$")
scatter!(ax, x, y_measurements; color=:tomato, label="Noisy measurements")
lines!(ax, x, y_true; color=:blue, linestyle=:dash, label="True Value")
axislegend(; position=:rb)
f