carpentries-incubator / carpentries-incubator/collaborative-git-and-github-lesson

Explicitly use code in the collaborative demo & exercises

Open
#19 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
R
Stars
0
Forks
3
PR merge metrics
No merged PRs in 30d

Description

As an instructor it would be better if we use realistic code in the collaborative workflow demo. This way the process as well as review becomes more realistic and the purpose of submitting a merge request and peer review becomes clearer.

Then the exercise should also provide explicit instructions for participants, currently students often use very non-realistic code/text.

I suggest to actually simulate working in a software development team.
We could work on a small program that calculates the mass of a planet.

```python
def calculate_planet_mass(gravitational_acceleration, radius):
# Gravitational constant (in N*m^2/kg^2)
G = 6.67430e-11

# Calculate the mass of the planet using the formula M = g * r^2 / G
mass = (gravitational_acceleration * radius**2) / G

return mass

# Example usage:
gravitational_acceleration_earth = 9.81 # in m/s^2
radius_earth = 6.371e6 # in meters (6,371 km)

mass_earth = calculate_planet_mass(gravitational_acceleration_earth, radius_earth)
```
This program needs to work at all times (otherwise we make Vlad or Wolfman angry or whatever XD), so we need to work in a separate branch.

I suggest the following issues:
- Issue for demo: add an example usage of the `calculate_planet_mass` function for Earth (like in code above)
- Issue for participants: add an example usage for Mars (provide parameters)
- Issue for participants: add a function `calculate_planet_volume` (provide formula)

In the exercise:
Both persons work on the same repository.
Person A creates issue 1
Person B creates issue 2
Person A works on issue 2
Person B works on issue 1

Requirements:
- Instructions for the demo should have explicit code examples
- Exercise for participants should have explicit code examples
- A Python and R version to accommodate different audiences

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.