Skip to content

Commit

Permalink
Revert "Merge branch 'clean-ipynb' into testing"
Browse files Browse the repository at this point in the history
This reverts commit 004b052, reversing
changes made to 8ed91d8.
  • Loading branch information
thvitt committed Oct 11, 2017
1 parent 4b94039 commit e422f85
Show file tree
Hide file tree
Showing 10 changed files with 10,945 additions and 411 deletions.
58 changes: 0 additions & 58 deletions .gitattributes

This file was deleted.

36 changes: 0 additions & 36 deletions docs/CONTRIBUTING.md → CONTRIBUTING.md
Expand Up @@ -30,42 +30,6 @@ Pushing to master is protected, you can only push heads that have an "green" sta

If something goes wrong, `git reset --hard master origin/master` and try again.

## Committing Jupyter Notebooks

Our Jupyter Notebooks should be committed without their output cells and execution counts since generated output of
probalistic methods makes version control unneccessarily complicated. The script <ipynb_drop_output.py> makes output
stripping easy, but requires some preparation:

### Preparation for each contributor machine

Every contributor should:

1. place the <ipynb_drop_output.py> script somewhere on the `$PATH`
2. make it executable (`chmod a+x ipynb_drop_output.py`)
3. configure a git filter called `clean_ipynb` as follows:

```bash
git config --global filter.clean_ipynb.clean ipynb_drop_output.py
git config --global filter.clean_ipynb.smudge cat
```

This will edit your `~/.gitconfig` so you globally have this filter available. The filter is linked to notebooks using
an entry in the `.gitattributes` file, this is already configured for this project.

### Preparation of each notebook

Each notebook needs a metadata entry to enable the filter. Open the notebook in Jupyter, click _Edit / Edit Notebook Metadata_
and add the following entry to the outermost dictionary:

```json
"git": {
"suppress_outputs": true
},
```

Now, when you add this notebook to the index or try to run a diff on it, the script is used to prepare a clean version.
Your working copy will not be modified, so _you_ will see the output cells and execution counts you generated.

## Documentation

The documentation is built using [Sphinx](http://www.sphinx-doc.org/).
Expand Down

0 comments on commit e422f85

Please sign in to comment.