Skip to content
This repository has been archived by the owner on Nov 12, 2019. It is now read-only.

Bash Projects instructions #81

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/projects/media/bash_tests_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 20 additions & 13 deletions docs/projects/projects-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ After that follows around 8 - 10 *tasks*, where each task consists of the follow
2. `@context` : `markdown` - The context for the task. Will be part of the student's notebook.
3. `@instructions` : `markdown` - The instructions for the task. Will be displayed in the sidebar.
4. `@hint` : `markdown` - The hint that will be displayed at the bottom of the sidebar.
5. `@sample_code` : `code` - The code scaffold that the student will edit in the live project.
5. `@sample_code` : `code` - The code scaffold that the student will edit in the live project.
6. `@solution` : `code` - The solution to the task, it's currently not shown in the live project.
7. `@tests` : `code` - Tests that check if the student is doing the right thing in the task.

Expand All @@ -39,7 +39,7 @@ This image does not show the `@solution` and `@tests` cells as these are never s
You are free to include any other cells in a Project notebook (for example to store material you're not using or for a todo list), but *all extra cells* -- except those having the tags above -- will be filtered away and will not be part of the final live project.


> #### info::Check out a live project!
> #### info::Check out a live project!
> Maybe the easiest way of understanding the structure of a DataCamp Project notebook is to check out an already existing Project. For example, download and take a look at the `project.ipynb` in *Dr. Semmelweis and the discovery of handwashing*. Here is the [python GitHub repo](https://github.com/datacamp/projects-discovery-of-handwashing-python) (and [live project](https://projects.datacamp.com/projects/20)), here is the [R GitHub repo](https://github.com/datacamp/projects-discovery-of-handwashing-r) (and [live project](https://projects.datacamp.com/projects/49)).

The format of the different cells
Expand All @@ -48,7 +48,7 @@ The format of the different cells
> `type:NotebookTask` : `markdown` < {#notebooktask}
----------------------------------------------------

This is the `markdown` cell that marks the beginning of a new task. It should contain a one-line, second lever header (H2), with the title of the task. In markdown a second lever header is written like this:
This is the `markdown` cell that marks the beginning of a new task. It should contain a one-line, second lever header (H2), with the title of the task. In markdown a second lever header is written like this:

```
## A H2 header in markdown
Expand Down Expand Up @@ -119,7 +119,7 @@ The `@instructions` to the first task should include a "Good to know" section wh
> `@hint` : `markdown` < {#hint}
---------------------------------

This is the `markdown` cell that populates the *hint tab* at the bottom of the instructions sidebar. While the `@instructions` can also include help and hints, the hint tab is meant for Students who are *stuck*.
This is the `markdown` cell that populates the *hint tab* at the bottom of the instructions sidebar. While the `@instructions` can also include help and hints, the hint tab is meant for Students who are *stuck*.

**Style guide:**

Expand All @@ -135,26 +135,26 @@ This is the `markdown` cell that populates the *hint tab* at the bottom of the i
> `@sample_code` : `code` < {#sample-code}
-------------------------------------------

This is the `code` cell that will show up in the student's notebook. It should have the same disposition as the `@solution` but with parts or all of the code missing. The purpose of the `@sample_code` is to give the student enough structure and code scaffolding to be able to complete the task.
This is the `code` cell that will show up in the student's notebook. It should have the same disposition as the `@solution` but with parts or all of the code missing. The purpose of the `@sample_code` is to give the student enough structure and code scaffolding to be able to complete the task.

**Style guide:**
**Style guide:**

- It should consist of between 1 to 10 lines of code and comments.
- The student should have to complete between 1 to 5 lines of code.
- Use `...` in python and `....` in R to indicate that code needs to be filled in.
- For code within a line:
- For code within a line:
```
# For Python
horse_data = ...

# For R
horse_data <- ....
```
- For code where one or more lines are missing:
```
# For Python
# ... YOUR CODE FOR TASK 3 ...
# ... YOUR CODE FOR TASK 3 ...

# For R
# .... YOUR CODE FOR TASK 3 ....
```
Expand Down Expand Up @@ -182,7 +182,7 @@ This is the `code` cell that is the completed version of the corresponding `@sam
- For R
- Use `underscore_separated` identifiers.
- Use "double quotes for strings.
- Use the `<-` arrow for assignment.
- Use the `<-` arrow for assignment.


**python example**
Expand All @@ -207,14 +207,21 @@ This is the `code` cell that checks the Student's solution to the task. The main

### Tests for python ###

For python, the tests are written using [the nose testing framework](http://nose.readthedocs.io/en/latest/#installation-and-quick-start) and uses the [`ipython_nose` magic](https://github.com/akaihola/ipython_nose). Every `@tests` cell needs to start with the [ipython_nose magic](https://github.com/akaihola/ipython_nose) `%%nose`.
For python, the tests are written using [the nose testing framework](http://nose.readthedocs.io/en/latest/#installation-and-quick-start) and uses the [`ipython_nose` magic](https://github.com/akaihola/ipython_nose). Every `@tests` cell needs to start with the [ipython_nose magic](https://github.com/akaihola/ipython_nose) `%%nose`.

[**Click here for examples of different python tests and for how to install nose and ipython_nose**](projects-test-examples.md/#tests-python).

**python example:**
![](media/python_tests_example.png)

### Tests for Bash ###

For Bash, the tests also use ipython_nose like python, the only difference that as well as the `%%nose` needed at the start of the test cell, it also needs to include `#DC_GRADE`.

[**Click here for examples of different bash tests and for how to install nose and ipython_nose**](projects-test-examples.md/#tests-bash).

**bash example:**
![](media/bash_tests_example.png)

### Tests for R ###

Expand All @@ -223,4 +230,4 @@ For R, the tests are written using [the testthat framework](https://github.com/r
[**Click here for examples of different R tests and for how to install testthat and IRkernel.testthat**](projects-test-examples.md/#tests-r) .

**R example:**
![](media/r_tests_example.png)
![](media/r_tests_example.png)
21 changes: 11 additions & 10 deletions docs/projects/projects-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Here are the steps for creating a DataCamp Project:
4. [Writing the Project notebook](#projects-writing-notebook).
- When the Project spec is finished, your DataCamp contact will add a scaffold around it, where the instructions and tests will go. With this scaffold in place, you can complete the rest of your Project.
5. [Launching the Project](#projects-launching).
- When the Project notebook is finished, we will beta test it and launch it on DataCamp. As part of the launch, you'll make an unpretentious introduction video to your Project.
- When the Project notebook is finished, we will beta test it and launch it on DataCamp. As part of the launch, you'll make an unpretentious introduction video to your Project.

During this process, you will work closely with your DataCamp contact, and each step above also includes receiving and integrating feedback from your DataCamp contact.

Expand Down Expand Up @@ -47,6 +47,7 @@ If you're doing data science in python chances are you're already using Jupyter

* [Instructions for how to install Jupyter](http://jupyter.org/install.html). Make sure to chose python 3.
* If you are creating a Project in R you also need [the R-kernel for Jupyter](https://irkernel.github.io/installation/).
* If you are creating a Project in Bash you also need [our Bash-Kernel for Jupyter](https://github.com/datacamp/bash_kernel)
* A quick video introduction to Jupyter: https://youtu.be/Hr4yh1_4GlQ
* All text in a Jupyter notebook is written using markdown. If you don't know markdown, you can learn it in 10 minutes here: http://commonmark.org/help/tutorial/index.html

Expand All @@ -62,12 +63,12 @@ GitHub is a web front-end for the Git version control system and is where all th

To this end, here are some guidelines for what makes a good Project:

- **The more applied the topic of the Project is, the better.** Areas the Project topic could come from include, but are not limited to: Healthcare, finance, online retail, applied research, official statistics, software engineering, mobile gaming, insurance, education, media & entertainment, logistics, web analytics, etc.
- **The more applied the topic of the Project is, the better.** Areas the Project topic could come from include, but are not limited to: Healthcare, finance, online retail, applied research, official statistics, software engineering, mobile gaming, insurance, education, media & entertainment, logistics, web analytics, etc.
- **Real-world case studies are a good basis for a Project.** A goal of DataCamp projects is to give Students real-world experience, with real-world datasets. A topic related to your company or research could make a great Project. It is no problem, rather the opposite, if you want to feature your company or institution as part of the Project.
- **A Project should be doable during a Lunch break.** While the name "Project" signals a large undertaking, this should not be the case. A DataCamp student should be able to complete a Project in less than an hour, and "short case study" would be a more fitting description.
- **Students should be able to apply what they've learned in DataCamp courses.** Students on the DataCamp platform learn new tools in courses and apply these tools in Projects. A challenge with creating a Project is to make sure that Students can learn the skills required to complete it from a DataCamp course. If you are uncertain what's covered in DataCamp courses, then your DataCamp contact will help you with this.
- **A Project should be doable during a Lunch break.** While the name "Project" signals a large undertaking, this should not be the case. A DataCamp student should be able to complete a Project in less than an hour, and "short case study" would be a more fitting description.
- **Students should be able to apply what they've learned in DataCamp courses.** Students on the DataCamp platform learn new tools in courses and apply these tools in Projects. A challenge with creating a Project is to make sure that Students can learn the skills required to complete it from a DataCamp course. If you are uncertain what's covered in DataCamp courses, then your DataCamp contact will help you with this.

It is generally no problem if you want to re-purpose already existing material (such as a blog post or existing case study) as a DataCamp project.
It is generally no problem if you want to re-purpose already existing material (such as a blog post or existing case study) as a DataCamp project.


## 3. Writing the Project specification {#projects-writing-specification} ##
Expand All @@ -80,12 +81,12 @@ The Project spec should be self-explanatory and is available here:
* [Project spec notebook for python](notebooks/datacamp_python_project_spec.ipynb). [Preview it on GitHub](https://github.com/datacamp/authoring/blob/master/docs/projects/notebooks/datacamp_python_project_spec.ipynb).
* [Project spec notebook for R](notebooks/datacamp_r_project_spec.ipynb). [Preview it on GitHub](https://github.com/datacamp/authoring/blob/master/docs/projects/notebooks/datacamp_r_project_spec.ipynb).

When you've completed the Project spec just e-mail it to your DataCamp contact. Make sure to include all external resources (like datasets, images, etc.) as e-mail attachments, or put them online and link to them from the notebook.
When you've completed the Project spec just e-mail it to your DataCamp contact. Make sure to include all external resources (like datasets, images, etc.) as e-mail attachments, or put them online and link to them from the notebook.

When both you and your DataCamp contact have OK'd the Project specification, the Project creation process officially begins:

* You and DataCamp will sign a Project authoring contract. Please ask your DataCamp contact if you have questions about this contract.
* Your DataCamp contact will set up a GitHub repository for your Project. Until the Project is released, you will work in the `develop` branch of the repository.
* Your DataCamp contact will set up a GitHub repository for your Project. Until the Project is released, you will work in the `develop` branch of the repository.
* Your DataCamp contact will copy the relevant parts of the Project spec into `project.yml` (the metadata of your project) and `project.ipynb`. Here is [more information about the filestructure of a Project](projects-repo-structure.md).


Expand All @@ -94,7 +95,7 @@ When both you and your DataCamp contact have OK'd the Project specification, the

A finished Project consists of a Jupyter notebook that contains a data narrative, which is supplemented by instructions, hints, and correctness checks. When you've completed the project spec, your DataCamp contact will add a scaffold around it -- with all the code and markdown cells required in a finished Project -- and put it into the `project.ipynb` notebook in your GitHub repo. It is now up to you to fill in the scaffold and complete the Project.

See the [Project notebook format](projects/projects-format.md) for instructions and a style guide.
See the [Project notebook format](projects/projects-format.md) for instructions and a style guide.

The steps of completing the Project notebook are:

Expand Down Expand Up @@ -125,7 +126,7 @@ When you have completed the Project notebook your DataCamp contact will send out

As part of the Project launch, you'll make a 20 to 30 sec. video that introduces the Project. This is an opportunity to let the student know a bit about you and to make students excited to do your Project. Here is an example introduction video for the python Project *Dr. Semmelweis and the discovery of handwashing*:

<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/NzsaLfZ-QfA?rel=0" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/NzsaLfZ-QfA?rel=0" frameborder="0" allowfullscreen></iframe>

<br>

Expand All @@ -135,7 +136,7 @@ As part of the Project launch, you'll make a 20 to 30 sec. video that introduces
* The video should be around 20 - 30 seconds long.
* It can be filmed using your laptop's web camera or using a high-end mobile phone. Here are guides for recording your web camera on [macOS](http://osxdaily.com/2016/12/04/record-video-mac/), [Windows](https://support.microsoft.com/en-us/help/17444/windows-camera-app-webcams-help), and [Linux/GNU](https://help.ubuntu.com/community/Webcam).
* Make sure that you are in a quiet environment and that the lighting is good.
* Don't worry if you don't get started right away in the video. Your DataCamp contact will trim the beginning and end of the video for you.
* Don't worry if you don't get started right away in the video. Your DataCamp contact will trim the beginning and end of the video for you.
* The video should introduce you and your Project. Here is a handy template script you can follow:
```text
Hi, I'm {name} and I'm {current position}.
Expand Down
17 changes: 16 additions & 1 deletion docs/projects/projects-test-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ pip install git+https://github.com/datacamp/ipython_nose
The test examples are a work in progress. In the meantime, you can check out the `@tests` cells in this example `project.ipynb` from the Project *Dr. Semmelweis and the discovery of handwashing*. Here is the [python GitHub repo](https://github.com/datacamp/projects-discovery-of-handwashing-python) (and [live project](https://projects.datacamp.com/projects/20)).


`@tests` in bash {#tests-bash}
-----------------------------------

There are some packages you need to be able to run tests locally. Run the following commands in a terminal to install them:

*You might need to change pip into pip3 depending on how you installed python.*

```
pip install nose
pip install git+https://github.com/datacamp/ipython_nose
```

The test examples are a work in progress. In the meantime, you can check out the `@tests` cells in this example `project.ipynb` from the *Example Project*. Here is the [GitHub repo](https://github.com/datacamp/project-shell-test) (and [live project](https://projects.datacamp.com/projects/164)).


`@tests` in R {#tests-r}
-----------------------------------

Expand All @@ -30,4 +45,4 @@ install.packages(testthat")
devtools::install_github('datacamp/IRkernel.testthat')
```

The test examples are a work in progress. In the meantime, you can check out the `@tests` cells in this example `project.ipynb` from the Project *Dr. Semmelweis and the discovery of handwashing*. Here is the [R GitHub repo](https://github.com/datacamp/projects-discovery-of-handwashing-r) (and [live project](https://projects.datacamp.com/projects/49)).
The test examples are a work in progress. In the meantime, you can check out the `@tests` cells in this example `project.ipynb` from the Project *Dr. Semmelweis and the discovery of handwashing*. Here is the [R GitHub repo](https://github.com/datacamp/projects-discovery-of-handwashing-r) (and [live project](https://projects.datacamp.com/projects/49)).