Skip to content

Commit

Permalink
Merge pull request #28 from ARCTraining/new-project
Browse files Browse the repository at this point in the history
Change the Project and some small fixes
  • Loading branch information
patricia-ternes authored Mar 1, 2024
2 parents b341b3c + 2e29f00 commit 08dd8a9
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 35 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## About

Book used in Training sessions for first year CDT Fluid Dynamics students - 2022
Book used in Training sessions for first year CDT Fluid Dynamics students

[Book Link](https://arctraining.github.io/SD_tips_tools/)

Expand Down
49 changes: 32 additions & 17 deletions book/intro.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,44 @@
# Software development - good practices and tips
# Software development - Good Practices and Tips

:::{note}
RSE training sessions for first year CDT Fluid Dynamics students
:::

## Schedule

| Session | Date | Time | Room |
| ------------------------------------------ | -------------- | ------------- | ----------------------------- |
| Part 1: Software development in a nutshell | Wed 08/03/2023 | 14:00 - 17:00 | Richard Hughes Cluster (1.40) |
| Part 2.1: Introduction to Version Control | Tue 14/03/2023 | 13:00 - 16:00 | Richard Hughes Cluster (1.40) |
| Part 2.2: Github | Wed 15/03/2023 | 13:00 - 16:00 | Textiles Cluster G.34 |
| Part 3.1: Defensive programming | Mon 20/03/2023 | 13:00 - 16:00 | Richard Hughes Cluster (1.40) |
| Part 3.2: Test driven development | Tue 21/03/2023 | 13:00 - 16:00 | Richard Hughes Cluster (1.40) |
| Part 3.3: Bringing it all together | Wed 22/03/2023 | 13:00 - 16:00 | Richard Hughes Cluster (1.40) |
## Suggested Agenda

### Day 1

| Time | Agenda |
| ---- |:---------------------------------------- |
| 1000 | Software Dev. Life Cicle |
| 1100 | Break |
| 1110 | Open and Reproducible Work: Tips & Tools |
| 1200 | Lunch |
| 1300 | Intro to Version Control |
| 1450 | Break |
| 1500 | GitHub |
| 1600 | Close |

### Day 2

| Time | Agenda |
| ---- |:----------------------- |
| 1000 | Defensive programming |
| 1100 | Break |
| 1110 | Test driven development |
| 1200 | Lunch |
| 1300 | Project |
| 1450 | Break |
| 1500 | Project |
| 1600 | Close |

*The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.*

## Slides
## Additional Material

- [Software development in a nutshell](https://raw.githack.com/ARCTraining/SD_tips_tools/main/slides/CDT-training_1.html)
- [Introduction to Version Control](https://raw.githack.com/ARCTraining/SD_tips_tools/main/slides/CDT-training_2-1.html)
- [Defensive Program](https://raw.githack.com/ARCTraining/SD_tips_tools/main/slides/CDT-training_3-1.html)
- [Test Driven Development](https://raw.githack.com/ARCTraining/SD_tips_tools/main/slides/CDT-training_3-2.html)
- [Final Project](https://raw.githack.com/ARCTraining/SD_tips_tools/main/slides/CDT-training_3-3.html)
- [Slides](https://arctraining.github.io/rc-slides/swd3.html#/meta-code)
- [Demo Repository](https://github.com/ARCTraining/swd3-demo)
- [Alan Turing Institute RSE Course Material](https://alan-turing-institute.github.io/rse-course/html/index.html)

## Instructors

Expand Down
57 changes: 40 additions & 17 deletions book/project/study-case.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ The aim is to practice:
- Development
- Testing
- Make use of good practices:
- virtual environment (using `conda`)
- environment (using `conda`)
- project layout
- code formatting (using `black`)
- code formatting (using `black` and `flake8`)
- Use version control collaboratively:
- git
- GitHub
Expand All @@ -23,25 +23,48 @@ The aim is to practice:
- issues
- Test-driven development

## The Problem
## The Hypotenuse Problem

Participants must develop a code to find where two or more time series overlap.
The range of each time series is represented as a pair of numbers,
which are the time the interval started and ended.
The output is the largest range that they all include:
Calculating the hypotenuse

![Range overlap](../assets/img/project/range_overlap.png)
$$ c = \sqrt{a^2 + b^2} $$

General Design

- 1 squared function
- 1 sum function
- 1 square root function
- 1 hypotenuse function that uses the functions above

## Project Workflow

1. Brainstorm to define all necessary tasks
2. List all scenarios/tests
3. Setup the project structure
4. Setup the environment
5. Develop the test unit
6. Develop the main code
7. Develop some documentation
8. Update the GitHub
9. EXTRA: Using GitHub actions to trigger pytest. See more [here](https://vilisimo.com/blog/setting-up-pytest-with-github-actions/).
Ideally, this is a task to be done in pairs.

1. Install Git, Anaconda, VScode
2. Create a GitHub repository + Licence + .gitignore + Readme
3. Setup GH Action for testing (Python Application)
4. Clone GH repository in local machines
5. Brainstorm to define all necessary tasks
6. List all scenarios/tests
7. Create project structure (source (name of the package) and test folders)
8. Setup the environment
9. Develop the test unit (start with `test_`)
10. Develop the main code
11. Lint code and tests
12. Develop some documentation (you can use `autoDocstring - Python Docstring Generator on VS Code`)
13. Update the GitHub
14. Check the action: is your code linted, is your code passing the tests?

*Please note that these ideas are just a starting point - participants will be free to design their project, as long as they respect the main idea and requirements.*

## Solution

The [`swd3-demo` repository](https://github.com/ARCTraining/swd3-demo) is a demonstration of how this project can be solved.
It also includes some additional features:

- Source Code
- Test with Pytest Framework
- Documentation website with Sphinx Framework
- Installation file for local install
- GitHub Actions for Linting, testing, and create documentation
- Release

0 comments on commit 08dd8a9

Please sign in to comment.