GithubHelp home page GithubHelp logo

willingc / nbdiff Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tarmstrong/nbdiff

0.0 1.0 0.0 47.95 MB

A diffing and merging tool for the IPython Notebook.

Home Page: http://nbdiff.org

License: MIT License

nbdiff's Introduction

NBDiff

image

image

image

A tool for diffing and merging IPython Notebook files.

This project was built by a team of university students from Concordia University. See AUTHORS for more information.

Installation

Using Pip

If you have pip installed:

$ pip install nbdiff

From Source

  1. Download the code from this repository
  2. Run python setup.py develop

Configure Git/Mercurial

Configuring nbmerge to work with your version control system can be helpful but is not required.

NBMerge is compatible with Mercurial out of the box by running hg merge --tool=nbmerge <branch>.

Git, however, needs to be configured by adding the following to your .gitconfig file:

[mergetool "nbmerge"]                                                           
  cmd = nbmerge $LOCAL $BASE $REMOTE $MERGED

Alternatively, you can run the following command to add this configuration automatically:

$ git config --global mergetool.nbmerge.cmd = "nbmerge \$LOCAL \$BASE \$REMOTE \$MERGED"

You can then run nbmerge from git like so:

$ git mergetool --tool=nbmerge

Usage

NBDiff

NBDiff launches a server at localhost:5000 and allows you to view a simple 2-pane diff of two notebook files.

usage: nbdiff [-h] [before after]

Produce a diffed IPython Notebook from before and after notebooks. If no
arguments are given, nbdiff looks for modified notebook files in the version
control system. The resulting diff is presented to the user in the browser at
http://localhost:5000.

positional arguments:
  before      The notebook to diff against.
  after       The notebook to compare `before` to.

optional arguments:
  -h, --help  show this help message and exit

NBMerge

nbmerge launches

:

usage: nbmerge [-h] [local base remote [result]]

nbmerge is a tool for resolving merge conflicts in IPython Notebook files. If
no arguments are given, nbmerge attempts to find the conflicting file in the
version control system. Positional arguments are available for integration
with version control systems such as Git and Mercurial.

Once nbmerge is run, the UI can be accessed at http://localhost:5000

positional arguments:
  notebook

optional arguments:
  -h, --help  show this help message and exit

Developing

Run the Python tests

To get all of the dependencies necessary to test nbdiff, run:

$ pip install -r requirements-dev.txt

To run the python tests, run the following command:

$ python setup.py nosetests

NBDiff adheres to PEP-8. To check the code against PEP-8, use flake8 like so:

$ flake8 tests nbdiff

To check Python test coverage, install coverage and run the tests with the --with-coverage option.

$ pip install coverage
$ python setup.py nosetests --with-coverage

Run the JavaScript tests

First, install node and npm.

Second, install the JavaScript dependencies using npm.

$ npm install

Finally, run the tests with grunt. You should output similar to the following. Note that grunt will not only run the tests, but check for common style problems with jshint.

$ grunt

Running "qunit:files" (qunit) task
Testing src/test/index.html ...OK
>> 14 assertions passed (21ms)

Done, without errors.

nbdiff's People

Contributors

tarmstrong avatar bpipev avatar selenaaa avatar nightlybuilds avatar shurouq avatar mandmk avatar linanouh avatar

Watchers

James Cloos avatar

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.