GithubHelp home page GithubHelp logo

exoticdft / code-review.org-tutorial Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scientific-software-reviewers/tutorial

0.0 0.0 0.0 5.64 MB

Code review tutorial exercises

License: MIT License

Python 48.34% Fortran 43.15% Makefile 8.52%

code-review.org-tutorial's People

Contributors

hkershaw-brown avatar

code-review.org-tutorial's Issues

text: Exercise 2

Text Exercise 2: Women's world cup

In an article about the Women's world cup there has been a mix up between football, soccer, and the NFL.

Take a look at the article world_cup.md

  • Are you familiar with the subject matter?
  • Can you review the article without being an expert on the subject?

Take a look at the pull request:

  • Does the pull request address the issue?
  • Is the solution overly complicated? Add a comment on what you think is unnecessary? What is a good way to phrase your comment, what is a bad way?
  • What would improve the pull request? Add your review: Approve or Request changes
  • For your own code, do you write for a global audience? Would Google's developer documentation style guide be helpful?

python: Exercise 1

Python Exercise 1: Printing out vowels and consonants

A python script vowel_counter.py is supposed to print out the number of vowels and consonants in a string.
Several users have reported problems, and one user has put in a pull request to improve the script.

User reports:

Only vowels are getting printed out! This script is not working
This script is printing the number of consonants.
Why is `vowel_counter.py` even printing out the number of consonants?  

Take a look at the python script vowel_counter.py

  • Can you see any errors?
  • Do you need to run the script to test the behavior?

Take a look at the pull request.

  • Does the pull request address the issue?
  • Are the comments up to date, necessary, helpful? Would you remove some of these comments? Add suggestions for which comments to remove and/or change.
  • Are there any bugs?
  • What would improve the pull request? Could you use list comprehension? Would you except the solution as it is now?

text: Exercise 3

Text Exercise 3: Origami instructions

A person following along with an origami tutorial suspects that the
instructions are incorrect. Here is their feedback:

The origami fish instructions are missing at least one step.
I followed the instructions and did not get a fish.

Take a look at the instructions origami.md

  • Are there missing steps?
  • Are the steps in the correct order?

Take a look at the pull request

  • Does the pull request address the issue?
  • Are there any unnecessary or incorrect changes?
  • What would improve the pull request?
  • Would you write the instructions differently for adults versus children?

Fortran: Exercise 2

Fortran Exercise 2: Refactoring

A team member (Betty) has been working on a project to simulate
a football league over a season. Betty's code is all in one
program in a single file, league_sim.f90.
However, Betty would now like to use the routines contained in the main program
in several of their other programs.

Betty created a module to enable the routines to be used by other programs and
submitted their changes in a pull request. They'd like you to take a look at their code
and offer suggestions on how to improve it.

Take a look at the pull request:

  • What would make the pull request easier to review?
  • What would improve the pull request? Add a comment.
  • Are the comments up to date, necessary, helpful?
  • Would you remove some of these comments? Add suggestions for which comments to remove and/or change.
  • Which module variables and routines should be public?
  • Add a suggestion for which variables/routines to make private to the module.
  • Have any bugs been introduced during the code refactoring?

text: Exercise 1

Text Exercise 1: Cake recipe

People have reported several problems with a recipe

Some examples of user feedback:

Worst Chocolate Cake ever! Not even chocolatey
Yuk! salty

Take a look at the recipe cake.md.

  • Are there any problems?
  • Are there spelling errors?
  • Are there deal-breaking errors?
  • What would you say are definite changes that need to be made?

Take a look a the suggested improvements in the pull request.

  • Do the improvements make the recipe better?
  • Are there any unnecessary changes in the pull request?
  • Are there more improvements needed?

Notes:

The recipe is written in Markdown, a markup language for creating
formatted text using a plain-text editor. Markdown is commonly used
in README files on GitHub. To learn more about Markdown on Github view the
GitHub markdown documentation

python: Exercise 2

Python Exercise 2: Calculating experiment time windows

A lab group is using a python script to calculate the number of hour-long
experiments between an initial and final time.

Some background: The goal is to run the NSF NCAR space weather model
TIEGCM and stop every
hour to update the model using observations.
Each experiment uses observations from +/- 30 minutes from when the model
is stopped. This +/- 30 minutes is known as the experiment window.

The class time_window.py is the initialized
with the start time, the final time, and the delta (the duration of a single
experiment). From these input the number of experiments needed, and the start
and stop for both the model and the window are calculated.
The script run_test.py provided by the lab group
can be used to demonstrate the bug: run_test.py initializes the class and prints
the window and model times.

The issue: For one set of experiments, the delta was accidentally entered
as negative. The number of windows was calculated correctly, but the times
for each of the windows were incorrect.

The lab group want to add some error checking to the python script to prevent
this error happening again.

Take a look at time_window.py:

  • Where would you put the error check?
  • Are there other error checks that you think should be included in the script?

Take a look at the pull request:

  • Does the pull request address the issue?
  • Are there any unnecessary or incorrect changes?
  • What would make the pull request easier to review?
  • What would improve the pull request? Add a suggestion.

Fortran: Exercise 1

Fortran Exercise 1: Calculating Pi

A program to calculate pi is being used as a sample code to
compare how compiler options affect run time.

However, the program is producing an incorrect value for pi.

Take a look at the code. calc_pi.f90

  • Are there any errors that standout?
  • Is the code easy to understand?
  • What changes, if any, would you make to the code?

Take a look at the pull request

  • Does the pull request address the issue?
  • Are there any unnecessary or incorrect changes?
  • Why did the author change the precision? Can you find the commit message with the reason?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.