Skip to content

Commit

Permalink
Merge pull request #14 from neuroinformatics-unit/collaborative-playg…
Browse files Browse the repository at this point in the history
…round

tweaks from pair-programming
  • Loading branch information
alessandrofelder authored Oct 10, 2023
2 parents 11bc267 + 14f8058 commit 22d6e46
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
Binary file added icons/branch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/issue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/pull.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ format:
margin-left: 0
embed-resources: true
page-layout: full
default-image-extension: png
exercises:
org-repo: "rse-best-practices-course-2023/rse-best-practices-playground"
---
Expand Down
11 changes: 7 additions & 4 deletions slides/collaborate.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@
:::

::: {.column width="50%"}
* open / choose a task ("issue")
* write a solution to the task independent of main code (on a "branch"/"fork")
* open a solution proposal ("pull request")
* review a solution proposal ("pull request")
![](icons/issue){height=25 style="margin:0 !important"} open / choose a task

![](icons/branch){height=30 style="margin:0 !important"} write a solution to the task independent of main code

![](icons/pull){height=25 style="margin:0 !important"} open a solution proposal

![](icons/pull){height=25 style="margin:0 !important"} review a solution proposal
:::
::::

Expand Down
2 changes: 1 addition & 1 deletion slides/documentation.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_named_colors_mapping():
Docstrings (should) follow an [agreed convention](https://peps.python.org/pep-0257/){preview-link="true"}


## A first task: [writing a docstring](https://github.com/{{< meta exercises.org-repo >}})
## A first task: writing a docstring

``` {.python}
def calculate_fastest_time(time_list):
Expand Down
24 changes: 12 additions & 12 deletions slides/testing.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ def test_fastest_time_in_a_specific_case():
What we've called sanity checks are referred to as "test cases".
Try to cover all "edge" cases[^2]: what happens if ...?

* I pass an invalid input ("zero")
* I pass a simplest possible input ("one")
* I run the code several times ("two")
* I pass a typical input ("two to max-1")
* I pass the extremest allowable input ("max")
* I pass a too extreme input ("max+1")
* "zero": I pass an invalid input
* "one": I pass a simplest possible input
* "two": I run the code several times
* "two to max-1": I pass a typical input
* "max": I pass the extremest allowable input
* "max+1": I pass a too extreme input

[^2]: [A Beginner’s Guide to Testing: Error Handling Edge Cases](https://www.freecodecamp.org/news/a-beginners-guide-to-testing-implement-these-quick-checks-to-test-your-code-d50027ad5eed/)

Expand All @@ -89,12 +89,12 @@ Try to cover all "edge" cases[^2]: what happens if ...?
What we've called sanity checks are referred to as "test cases".
For example, what happens/should happen when you call...?

* `calculate_fastest_time("this is a string")` ("zero")
* `calculate_fastest_time([1.0])` ("one")
* `calculate_fastest_time([1.0]); calculate_fastest_time([2.0])` ("two")
* `calculate_fastest_time([1.0, 0.5, 2.0])` ("two to max-1")
* `calculate_fastest_time([1.0, 0.5, 2.0, sys.float_info.max])` ("max")
* `calculate_fastest_time([1.0, 0.5, 2.0, float("inf")])` ("max+1")
* "zero": `calculate_fastest_time("this is a string")`
* "one": `calculate_fastest_time([])`
* "two": `calculate_fastest_time([1.0]); calculate_fastest_time([2.0])`
* "two to max-1": `calculate_fastest_time([1.0, 0.5, 2.0])`
* "max": `calculate_fastest_time([1.0, 0.5, 2.0, sys.float_info.max]) # other extreme cases?`
* "max+1": `calculate_fastest_time([1.0, 0.5, 2.0, float("inf")])`

## Some software testing vocabulary

Expand Down

0 comments on commit 22d6e46

Please sign in to comment.