Skip to content

Commit 830b93f

Browse files
author
luward
committed
initial restructuring and sphinx setup
1 parent 19887e9 commit 830b93f

40 files changed

+1138
-410
lines changed

.envrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
source activate rust-data
2+
3+
export PROJECT_DIR=$PWD
4+
export PATH=$PWD/bin:$PATH
5+
export PYTHONPATH=$PWD/python:$PYTHONPATH
6+
export MATPLOTLIBRC=$PWD/configurations
7+
export JUPYTER_CONFIG_DIR=$PWD/configurations/jupyter
8+
export IPYTHONDIR=$PWD/configurations/ipython

.github/workflows/ci.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Continuous Integration
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-20.04
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: conda-incubator/setup-miniconda@v2
13+
with:
14+
activate-environment: rust-data
15+
environment-file: configurations/environment.yml
16+
python-version: 3.6
17+
auto-activate-base: false
18+
- name: check notebook formatting
19+
shell: bash -l {0}
20+
run: |
21+
export PATH="$PATH:/usr/share/miniconda/bin"
22+
source .envrc
23+
flake8-nb; [ $? -eq 0 ] || exit 1
24+
black-nb --check .; [ $? -eq 0 ] || exit 1
25+
- name: run project
26+
shell: bash -l {0}
27+
run: |
28+
export PATH="$PATH:/usr/share/miniconda/bin"
29+
source .envrc
30+
py.test
31+
run-project

.zenodo.json

-20
This file was deleted.

Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

README.md

-7
This file was deleted.

README.rst

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.. |logo| image:: https://raw.githubusercontent.com/OpenSourceEconomics/ose-corporate-design/master/logos/OSE_logo_no_type_RGB.svg
2+
:width: 4 %
3+
4+
|logo| Rust data
5+
==================
6+
7+
This repository contains the raw data from Rust (1987) and data reading and processing functions.
8+
9+
The data and the provided documentation can be found at John Rust's `homepage <https://editorialexpress.com/jrust/nfxp.html>`_.
10+
Please see the `documentation <https://rust-data.readthedocs.io/en/latest/index.html>`_ for details.
11+
12+
13+
Supported by
14+
------------
15+
16+
17+
.. image:: https://raw.githubusercontent.com/OpenSourceEconomics/ose-corporate-design/master/logos/OSE_logo_RGB.svg
18+
:width: 22 %
19+
:target: https://github.com/OpenSourceEconomics

bin/run-project

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../scripts/run_project.py

conf.py

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = 'Rust data'
21+
copyright = '2021, OpenSourceEconomics'
22+
author = 'OpenSourceEconomics'
23+
24+
25+
# -- General configuration ---------------------------------------------------
26+
27+
# Add any Sphinx extension module names here, as strings. They can be
28+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
29+
# ones.
30+
extensions = [
31+
"sphinx.ext.mathjax",
32+
"nbsphinx",
33+
"sphinx.ext.extlinks",
34+
"sphinx_rtd_theme",
35+
"sphinx.ext.doctest",
36+
"sphinxcontrib.bibtex",
37+
]
38+
39+
40+
# Add any paths that contain templates here, relative to this directory.
41+
templates_path = ['_templates']
42+
43+
# List of patterns, relative to source directory, that match files and
44+
# directories to ignore when looking for source files.
45+
# This pattern also affects html_static_path and html_extra_path.
46+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
47+
48+
# -- Options for nbsphinx ----------------------------------------
49+
nbsphinx_execute = "auto"
50+
51+
nbsphinx_prolog = r"""
52+
{% set docname = env.doc2path(env.docname, base=None) %}
53+
.. |binder| image:: https://mybinder.org/badge_logo.svg
54+
:target: https://mybinder.org/v2/gh/OpenSourceEconomics/rust-data/upgrade?filepath={{ docname|e }}
55+
56+
.. only:: html
57+
58+
.. nbinfo::
59+
Download the notebook :download:`here <https://nbviewer.jupyter.org/github/OpenSourceEconomics/rust-data/blob/upgrade/{{ docname }}>`!
60+
Interactive online version: |binder|
61+
"""
62+
63+
# -- Options for HTML output -------------------------------------------------
64+
65+
# The theme to use for HTML and HTML Help pages. See the documentation for
66+
# a list of builtin themes.
67+
#
68+
html_theme = "sphinx_rtd_theme"
69+
70+
# Add any paths that contain custom static files (such as style sheets) here,
71+
# relative to this directory. They are copied after the builtin static files,
72+
# so a file named "default.css" will overwrite the builtin "default.css".
73+
html_static_path = ['_static']

configurations/environment.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: rust-data
2+
3+
channels:
4+
- defaults
5+
- conda-forge
6+
- OpenSourceEconomics
7+
8+
dependencies:
9+
- python=3
10+
- pip=19.0.3
11+
- jupyterlab
12+
- matplotlib>=3.0.0
13+
- mkl
14+
- nbsphinx=0.4.2
15+
- numba>=0.43.1
16+
- numpydoc
17+
- pyaml
18+
- pytest-cov
19+
- pytest-xdist
20+
- numpy
21+
- restructuredtext_lint
22+
- scipy>=1.2.1
23+
- Sphinx>=2.0.0
24+
- black>=20.8b1
25+
- flake8
26+
- pytest-flake8
27+
- pytest
28+
- sphinx-autobuild
29+
- tox-conda
30+
- markupsafe<2.0
31+
- pip:
32+
- git+https://github.com/OpenSourceEconomics/respy
33+
- apprise
34+
- pre-commit
35+
- pysftp
36+
- pytest-black
37+
- Py-BOBYQA
38+
- DFO-LS
39+
- jupyterlab
40+
- sphinx-rtd-theme
41+
- sphinxcontrib-bibtex==1.0
42+
- sphinxcontrib-svg2pdfconverter[CairoSVG]
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
This is the IPython startup directory
2+
3+
.py and .ipy files in this directory will be run *prior* to any code or files specified
4+
via the exec_lines or exec_files configurables whenever you load this profile.
5+
6+
Files will be run in lexicographical order, so you can control the execution order of files
7+
with a prefix, e.g.::
8+
9+
00-first.py
10+
50-middle.py
11+
99-last.ipy
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from IPython import get_ipython
2+
3+
ipython = get_ipython()
4+
ipython.magic("matplotlib inline")
5+
ipython.magic("load_ext autoreload")
6+
ipython.magic("autoreload 2")
7+
8+
import warnings
9+
10+
warnings.simplefilter(action="ignore", category=RuntimeWarning)

0 commit comments

Comments
 (0)