Skip to content

Commit

Permalink
small tweaks (#24)
Browse files Browse the repository at this point in the history
* small tweaks

* Change name of exmple python module

* Change title of two slides

---------

Co-authored-by: lauraporta <[email protected]>
Co-authored-by: lauraporta <[email protected]>
  • Loading branch information
3 people authored Sep 23, 2024
1 parent 52bb2e6 commit f21caad
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 21 deletions.
20 changes: 13 additions & 7 deletions index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title-slide-attributes:
data-background-image: img/jukan-tateisi-bJhT_8nbUA0-unsplash.jpg
data-background-opacity: "0.5"
subtitle: An introduction to collaborative coding and software engineering good practice
author: Alessandro Felder*, Laura Porta, Chang Huan Lo
author: Alessandro Felder, Laura Porta, Chang Huan Lo
execute:
enabled: true
format:
Expand Down Expand Up @@ -47,12 +47,7 @@ exercises:
org-repo: "rse-best-practices-course/2024-course"
---


## Initial checkup

{{< include slides/mentimeter.qmd >}}

## Prerequisites {.smaller}
## Get ready! {.smaller}

:::: {.columns}

Expand All @@ -67,6 +62,10 @@ exercises:
::::


## Initial discussion

{{< include slides/mentimeter.qmd >}}

## The next steps
:::: {.columns}

Expand Down Expand Up @@ -128,6 +127,13 @@ pip install my_awesome_package
* Package your project 📦
* Share your project 🌍

## Other areas of good practice

* testing
* writing documentation
* asynchronous collaboration (issues and pull requests)


## Extra resources
If you want to practice refactoring, testing and documenting we have prepared [some exercises](https://github.com/{{< meta exercises.org-repo >}}/issues/)

Expand Down
14 changes: 7 additions & 7 deletions slides/packaging.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## How can I call my functions from a different project?
my_pipeline/
└── preprocess.py
└── analysis.py
└── plot.py
└── io.py (for reading/writing data)
└── my_analysis_pipeline.py
└── preprocess.py
└── analysis.py
└── plot.py
└── read_write.py
└── my_analysis_pipeline.py

## How can I call my functions from a different project?
{{< include slides/mentimeter.qmd >}}
Expand All @@ -23,9 +23,9 @@ my_pipeline/

::: {.column width="50%"}
Packaging allows Python to "install" your code so that it can be re-used from anywhere.
Local installation from the package directory:
Local, editable installation from the package directory:
```{.bash code-line-numbers="false"}
pip install .
pip install -e .
```
:::
::::
Expand Down
14 changes: 7 additions & 7 deletions slides/refactoring.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ You've written your analysis script, and it "works"... but it's chaotic:
Don't move on to the next project! Your work isn’t done yet.
:::

## How many code smells can we find here?
## Which code smells can we find here?
my_project/
└── do_all_analysis.py

Expand All @@ -70,7 +70,7 @@ data = pd.read_csv("/Users/helen/Desktop/29104629.csv")
spikes = process_data(data, a, b)
```

## How many code smells can we find here?
## Which code smells can we find here?

{{< include slides/mentimeter.qmd >}}

Expand Down Expand Up @@ -110,11 +110,11 @@ spikes = detect_spikes(data, SAMPLING_RATE, SPIKE_THRESHOLD)

## Make your code modular
my_pipeline/
└── preprocess.py
└── analysis.py
└── plot.py
└── io.py (for reading/writing data)
└── my_analysis_pipeline.py
└── preprocess.py
└── analysis.py
└── plot.py
└── read_write.py
└── my_analysis_pipeline.py

## An example pipeline
Import your functions and classes in your main analysis pipeline
Expand Down

0 comments on commit f21caad

Please sign in to comment.