Skip to content

Commit

Permalink
differences for PR #6
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Dec 8, 2023
1 parent 774447f commit 4266a07
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 39 deletions.
3 changes: 3 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ contact: '[email protected]'
# Order of episodes in your lesson
episodes:
- introduction.md
- profiling-introduction.md
- profiling-functions.md
- profiling-lines.md

# Information for Learners
learners:
Expand Down
41 changes: 39 additions & 2 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,45 @@
site: sandpaper::sandpaper_site
---

This is a new lesson built with [The Carpentries Workbench][workbench].
![Welcome to Performance Profiling & Optimisation (Python) Training!
](episodes/fig/pando-python-hex-sticker.png){
alt='Performance Profiling & Optimisation (Python) Training'
style='padding: 2%'}

The training curriculum for this course is designed for researchers that are writing Python and lack formal training. The curriculum covers how to assess where time is being spent during execution of a Python program, it also provides a high level understanding of how code executes and how this maps to the limiting factors of performance.

[workbench]: https://carpentries.github.io/sandpaper-docs
If you are now comfortable using Python, this course may be of interest to supplement and advance your programming knowledge. This course is particularly relevant if you are writing research code and desire greater confidence that your code is both performant and suitable for publication.

<!-- TODO: course duration? -->
<!-- TODO: confident code syllabus? -->


## Learning Objectives
<!-- Aim for 3-4 objectives for every 6 hours of training -->
<!-- SMART Objectives
- Specific
- Measureable
- Attainable (within the span of the course)
- Relevant
- Time-bound (implicitly the length of the course)
-->
<!-- Evaluation tool: https://web.cs.manchester.ac.uk/iloadvisor/ -->
After attending this training, participants will be able to:

- identify the most expensive functions and lines of code using `cprofile` and `line_profiler`.
- evaluate code to determine the limiting factors of it's performance.
- recognise and implement optimisations for common limiting factors of performance.

:::::::::::::::::::::::::::::::::::::::::: prereq

## Prerequisites

Before joining Performance Profiling & Optimisation (Python) Training, participants should be able to:

- implement basic algorithms in Python
- follow the control flow of Python code, and dry run the execution in their head or on paper.

See the [Research Computing Training Hub](https://sites.google.com/sheffield.ac.uk/research-training/research-training) for other courses to help with learning these skills.
<!-- TODO: could make a dedicated page (like https://carpentries.github.io/lesson-development-training/markdown-github-primer.html) that highlights specific courses/resources. -->

::::::::::::::::::::::::::::::::::::::::::::::::::
9 changes: 6 additions & 3 deletions md5sum.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
"file" "checksum" "built" "date"
"CODE_OF_CONDUCT.md" "c93c83c630db2fe2462240bf72552548" "site/built/CODE_OF_CONDUCT.md" "2023-12-07"
"LICENSE.md" "b24ebbb41b14ca25cf6b8216dda83e5f" "site/built/LICENSE.md" "2023-12-07"
"config.yaml" "509085b79e6ec689b015216d87ddbeff" "site/built/config.yaml" "2023-12-08"
"index.md" "a02c9c785ed98ddd84fe3d34ddb12fcd" "site/built/index.md" "2023-12-08"
"config.yaml" "9086af5e5e979722dcad1ab925ec6412" "site/built/config.yaml" "2023-12-08"
"index.md" "df8ef5258ba527e8fc3ca82f97fa27d8" "site/built/index.md" "2023-12-08"
"links.md" "8184cf4149eafbf03ce8da8ff0778c14" "site/built/links.md" "2023-12-07"
"episodes/introduction.md" "6c55d31b41d322729fb3276f8d4371fc" "site/built/introduction.md" "2023-12-07"
"episodes/profiling-introduction.md" "3c910052e7ff8e49edec82e5aa772f68" "site/built/profiling-introduction.md" "2023-12-08"
"episodes/profiling-functions.md" "8314ef242c3167976b86676f5f49a898" "site/built/profiling-functions.md" "2023-12-08"
"episodes/profiling-lines.md" "f21cb8b587a238657ac5bdf28df59e50" "site/built/profiling-lines.md" "2023-12-08"
"instructors/instructor-notes.md" "cae72b6712578d74a49fea7513099f8c" "site/built/instructor-notes.md" "2023-12-07"
"learners/reference.md" "1c7cc4e229304d9806a13f69ca1b8ba4" "site/built/reference.md" "2023-12-07"
"learners/setup.md" "61568b36c8b96363218c9736f6aee03a" "site/built/setup.md" "2023-12-07"
"learners/setup.md" "eda96a4aa0e52fe92f91868fb2ecd5c0" "site/built/setup.md" "2023-12-08"
"profiles/learner-profiles.md" "60b93493cf1da06dfd63255d73854461" "site/built/learner-profiles.md" "2023-12-07"
19 changes: 19 additions & 0 deletions profiling-functions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: "Function Level Profiling"
teaching: 0
exercises: 0
---

:::::::::::::::::::::::::::::::::::::: questions

- TODO

::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::: objectives

- execute a Python program via `cprofile` to collect profiling information about a Python program’s execution
- use `snakeviz` to visualise profiling information output by `cprofile`
- interpret `snakeviz` views, to identify the functions where time is being spent during a program’s execution

::::::::::::::::::::::::::::::::::::::::::::::::
19 changes: 19 additions & 0 deletions profiling-introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: "Introduction to Profiling"
teaching: 0
exercises: 0
---

:::::::::::::::::::::::::::::::::::::: questions

- TODO

::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::: objectives

- explain the benefits of profiling code and different types of profiler
- identify the appropriate Python profiler for a given scenario
- explain how to select an appropriate test case for profiling and why

::::::::::::::::::::::::::::::::::::::::::::::::
17 changes: 17 additions & 0 deletions profiling-lines.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: "Line Level Profiling"
teaching: 0
exercises: 0
---

:::::::::::::::::::::::::::::::::::::: questions

- TODO

::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::: objectives

- TODO

::::::::::::::::::::::::::::::::::::::::::::::::
45 changes: 11 additions & 34 deletions setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,30 @@
title: Setup
---

FIXME: Setup instructions live in this document. Please specify the tools and
the data sets the Learner needs to have installed.

<!--
## Data Sets
<!--
FIXME: place any data you want learners to use in `episodes/data` and then use
a relative link ( [data zip file](data/lesson-data.zip) ) to provide a
link to it, replacing the example.com link.
-->
Download the [data zip file](https://example.com/FIXME) and unzip it to your Desktop
-->

## Software Setup

::::::::::::::::::::::::::::::::::::::: discussion

### Details

Setup for different systems can be presented in dropdown menus via a `solution`
tag. They will join to this discussion block, so you can give a general overview
of the software used in this lesson here and fill out the individual operating
systems (and potentially add more, e.g. online setup) in the solutions blocks.

:::::::::::::::::::::::::::::::::::::::::::::::::::

:::::::::::::::: solution

### Windows

Use PuTTY
This course uses Python and was developed using Python 3.11, therefore it is recommended that you have a Python 3.11 or newer environment.

:::::::::::::::::::::::::
<!-- Todo suggest using a venv?-->

:::::::::::::::: solution

### MacOS

Use Terminal.app

:::::::::::::::::::::::::


:::::::::::::::: solution

### Linux

Use Terminal

:::::::::::::::::::::::::
The non-core Python packages required by the course are `snakeviz` and `line_profiler` and can be installed via `pip`.

```input
pip install snakeviz line_profiler[all]
```

:::::::::::::::::::::::::::::::::::::::::::::::::::

0 comments on commit 4266a07

Please sign in to comment.