Skip to content

alamgr89/coding-for-economists

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

coding-for-economists

Binder

This readme is intended to help those contributing to or editing the book, not those trying to follow it. To read or use the book, head to the coding for economists website. You can use the book interactively via the following options, all available via the link above:

  • download pages to your computer as jupyter notebooks
  • run pages in Google Colab through your browser
  • run pages in Binder through your browser

Dev

These instructions are only for developers working on the book.

Setting up the Environment

Install the environment using

conda env create -f environment.yml

on the command line. After installing the environment, activate using conda activate codeforecon, and use

python3.8 -m ipykernel install --user --name=codeforecon

to install a new named ipykernel. To ensure that Jupyter notebooks are running the correct kernel, open them in Jupyter notebook server and change the kernel there to 'codeforecon' and save it.

Building the Book

To build the book using Jupyter books use

jupyter-book build .

Once this command is run, you should be able to look at the HTML files for the book locally on your computer.

Uploading Built Files

See here for how to upload revised HTML files, but the key command is

ghp-import -n -p -f _build/html

To perform the pre-commit checks, use

pre-commit run --all-files

Pre-commit

Pre-commit is currently configured to:

  • check for large added files
  • strip outputs from notebooks
  • apply the black code formatter to .py and .ipnb scripts

If black-nb finds a pre-commit error that is difficult to diagnose, a tip is to convert it to a regular script to find the problem, using, for example,

jupytext --to py data-intro.ipynb

About

This repository hosts the code behind the online book, Coding for Economists.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 96.4%
  • HTML 2.4%
  • Other 1.2%