diff --git a/README.md b/README.md index c1178dc..37d19eb 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,31 @@ +# Building the Site Locally + +Both of these steps should be followed within `rterm`. + +## Setup + +```r +# Setup mirrors +options(repos = c( + carpentries = "https://carpentries.r-universe.dev/", + CRAN = "https://cran.rstudio.com/" +)) +# Setup install from github +install.packages("devtools") +library(devtools) +# Install Uni of Shef Varnish theme +install_github("RSE-Sheffield/uos-varnish") +# Install remaining official carpentries packages +install.packages(c("sandpaper", "tinkr", "pegboard")) +``` +## Development Server + +```r +sandpaper::serve() +``` + +-------------- + # The Carpentries Workbench Template Markdown Lesson This lesson is a template lesson that uses [The Carpentries Workbench][workbench]. diff --git a/config.yaml b/config.yaml index e348cce..2b58cbd 100644 --- a/config.yaml +++ b/config.yaml @@ -60,6 +60,9 @@ contact: 'robert.chisholm@sheffield.ac.uk' # Order of episodes in your lesson episodes: - introduction.md +- profiling-introduction.md +- profiling-functions.md +- profiling-lines.md # Information for Learners learners: diff --git a/episodes/fig/pando-python-hex-sticker.png b/episodes/fig/pando-python-hex-sticker.png new file mode 100644 index 0000000..baa80af Binary files /dev/null and b/episodes/fig/pando-python-hex-sticker.png differ diff --git a/episodes/profiling-functions.md b/episodes/profiling-functions.md new file mode 100644 index 0000000..d1d629b --- /dev/null +++ b/episodes/profiling-functions.md @@ -0,0 +1,17 @@ +--- +title: "Function Level Profiling" +teaching: 0 +exercises: 0 +--- + +:::::::::::::::::::::::::::::::::::::: questions + +- TODO + +:::::::::::::::::::::::::::::::::::::::::::::::: + +::::::::::::::::::::::::::::::::::::: objectives + +- TODO + +:::::::::::::::::::::::::::::::::::::::::::::::: \ No newline at end of file diff --git a/episodes/profiling-introduction.md b/episodes/profiling-introduction.md new file mode 100644 index 0000000..daaf633 --- /dev/null +++ b/episodes/profiling-introduction.md @@ -0,0 +1,17 @@ +--- +title: "Introduction to Profiling" +teaching: 0 +exercises: 0 +--- + +:::::::::::::::::::::::::::::::::::::: questions + +- TODO + +:::::::::::::::::::::::::::::::::::::::::::::::: + +::::::::::::::::::::::::::::::::::::: objectives + +- TODO + +:::::::::::::::::::::::::::::::::::::::::::::::: \ No newline at end of file diff --git a/episodes/profiling-lines.md b/episodes/profiling-lines.md new file mode 100644 index 0000000..08686bb --- /dev/null +++ b/episodes/profiling-lines.md @@ -0,0 +1,17 @@ +--- +title: "Line Level Profiling" +teaching: 0 +exercises: 0 +--- + +:::::::::::::::::::::::::::::::::::::: questions + +- TODO + +:::::::::::::::::::::::::::::::::::::::::::::::: + +::::::::::::::::::::::::::::::::::::: objectives + +- TODO + +:::::::::::::::::::::::::::::::::::::::::::::::: \ No newline at end of file diff --git a/index.md b/index.md index af66276..904bbd9 100644 --- a/index.md +++ b/index.md @@ -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. + + + + +## Learning Objectives + + + +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. + + +:::::::::::::::::::::::::::::::::::::::::::::::::: diff --git a/learners/setup.md b/learners/setup.md index 46eddd1..d2f151d 100644 --- a/learners/setup.md +++ b/learners/setup.md @@ -2,17 +2,15 @@ title: Setup --- -FIXME: Setup instructions live in this document. Please specify the tools and -the data sets the Learner needs to have installed. - + + Download the [data zip file](https://example.com/FIXME) and unzip it to your Desktop +--> ## Software Setup @@ -20,35 +18,14 @@ Download the [data zip file](https://example.com/FIXME) and unzip it to your Des ### 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. -::::::::::::::::::::::::: + -:::::::::::::::: 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] +``` +:::::::::::::::::::::::::::::::::::::::::::::::::::