diff --git a/index.qmd b/index.qmd index e6e1119..fc0f9b4 100644 --- a/index.qmd +++ b/index.qmd @@ -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: @@ -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} @@ -67,6 +62,10 @@ exercises: :::: +## Initial discussion + +{{< include slides/mentimeter.qmd >}} + ## The next steps :::: {.columns} @@ -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/) diff --git a/slides/packaging.qmd b/slides/packaging.qmd index 88676fd..880dc2f 100644 --- a/slides/packaging.qmd +++ b/slides/packaging.qmd @@ -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 >}} @@ -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 . ``` ::: :::: diff --git a/slides/refactoring.qmd b/slides/refactoring.qmd index 8719438..74528a5 100644 --- a/slides/refactoring.qmd +++ b/slides/refactoring.qmd @@ -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 @@ -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 >}} @@ -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