Git Product home page Git Product logo

analysis-template's Introduction

Analysis Template

A general template for analytics projects, inspired heavily by https://goodresearch.dev and https://nbdev.fast.ai/.

Getting Started

1. Generate Project

If you do not have cookiecutter installed, do so with:

> pip install cookiecutter

Next, generate your project:

> cookiecutter https://github.com/calremmel/analysis-template.git

2. Create Virtual Environment

Install basic dependences using the following command (assumes conda or mamba installed):

> conda env create -n ENV_NAME -f environment.yml

3. Configure Project

To make your packages in src importable from anywhere:

> pip install -e .

Next, in order to name your package:

> mv src PACKAGE_NAME

3. Configure Jupyter

Paired Markdown for Version Control

To auto-generate paired Markdown files for version-controlling notebooks:

  1. Open command palette with Cmd Shift C
  2. Select Pair Notebook with Markdown

Keyboard Shortcut for Restarting and Running All

To enable a shortcut for "Restart Kernel and Run All Cells":

  1. Open Advanced Settings with Cmd ,
  2. Select JSON Settings Editor in top-right corner
  3. Select Keyboard Shortcuts on left sidebar
  4. Copy in the following under User Preferences inside the curly brackets:
"shortcuts": [
        {
            "args": {},
            "command": "runmenu:restart-and-run-all",
            "keys": [
                "Cmd Shift Enter"
            ],
            "selector": "[data-jp-code-runner]"
        }
]

Feel free to replace Cmd Shift Enter with whatever you like.

Format Notebooks with both isort and black

To autoformat notebooks with both isort and black:

  1. Open Advanced Settings with Cmd ,
  2. Select JSON Settings Editor in top-right corner
  3. Select Jupyterlab Code Formatter on left sidebar
  4. Copy in the following under User Preferences replacing the "python" line under "default_formatter"
"python": ["isort", "black"]

analysis-template's People

Contributors

calremmel avatar

Watchers

 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.