Skip to content

Commit

Permalink
Merge pull request #2 from rickecon/init
Browse files Browse the repository at this point in the history
Merging
  • Loading branch information
rickecon authored Sep 29, 2023
2 parents cc0023e + c38f75d commit 84413e8
Show file tree
Hide file tree
Showing 52 changed files with 1,365 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Thanks for filing an issue. Please consider including the following information in your issue. This will help us efficiently respond to the issue and incorporate its valuable components into the repository. Please delete this paragraph, and feel free to include any of the following content that you think is relevant.

# Clear and concise title
Please give this issue a clear and concise title that directly references the key point in your issue.

# Problem or Error
Please characterize the problem concisely and precisely. You may want to include error message output, other terminal output, your environment characteristics, and a way to replicate the issue. Let us know what solutions you have tried. You may also want to include a minimal reproducible example (MRE; see [this Stackoverflow tutorial](https://stackoverflow.com/help/minimal-reproducible-example) and this [Wikipedia page](https://en.wikipedia.org/wiki/Minimal_reproducible_example)). These types of examples are referred to in other coding cotexts as "minimal,complete, and verifiable example (MCVE)", "minimal workable example (MWE)", "reprex", and "short, self-contained correct example (SSCCE)".

# Question
Please ask the question with clear context and any potential answer directions you can think of.
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Thanks for contributing! Please remove any top-level sections that do not apply to your changes.

- [ ] `make documentation`, `make format`, and `make test` have been run locally on my machine.

## What's changed

Description of the changes here. Link any issues this PR fixes.
47 changes: 47 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and test [Python 3.10, 3.11]

on: [push, pull_request]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11"]

steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Miniconda using Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
auto-update-conda: true
activate-environment: compmethods-dev
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
auto-activate-base: false

- name: Build
shell: bash -l {0}
run: |
pip install -e .
pip install pytest-cov
pip install pytest-pycodestyle
- name: Test
shell: bash -l {0}
working-directory: ./
run: |
pytest -m 'not local' --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
verbose: true
15 changes: 15 additions & 0 deletions .github/workflows/check_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

name: Check code formatting

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: psf/black@stable
with:
options: "-l 79 --check"
src: "."
38 changes: 38 additions & 0 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and Deploy Jupyter Book documentation
on:
push:
branches:
- main
jobs:
build-and-deploy:
if: github.repository == 'OpenSourceEcon/CompMethods'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
activate-environment: compmethods-dev
environment-file: environment.yml
python-version: "3.10"
auto-activate-base: false

- name: Build # Build Jupyter Book
shell: bash -l {0}
run: |
pip install -e .
python -m ipykernel install --user --name=compmethods-dev
cd docs
jb build ./book
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: docs/book/_build/html # The folder the action should deploy.
28 changes: 28 additions & 0 deletions .github/workflows/docs_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Check that docs build
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
activate-environment: compmethods-dev
environment-file: environment.yml
python-version: "3.10"
auto-activate-base: false

- name: Build # Build Jupyter Book
shell: bash -l {0}
run: |
pip install -e .
python -m ipykernel install --user --name=compmethods-dev
cd docs
jb build ./book
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
*.pyc
MANIFEST
build/*
dist/*
*.aux
*.bbl
*.blg
*.fdb_latexmk
*.idx
*.ilg
*.ind
*.lof
*.log
*.lot
*.out
*.pdfsync
*.synctex.gz
*.toc
*.swp
*.asv
*.nav
*.snm
*.gz
*.bib.bak
*.fls
*.m~
*.sublime*
.DS_Store
*puf.csv
*/OUTPUT/*
*/__pycache__/*
*.coverage*
*.pytest*
Icon?
.ipynb_checkpoints/*

# Built Jupyter-book documentation
docs/book/_build

# Backup docs
pdfs/*

12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.0.0] - 2023-09-28 17:00:00

### Added

- Created CompMethods repository at GitHub.com/OpenSourceEcon/CompMethods
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
format:
black . -l 79
linecheck . --fix
install:
pip install -e .
test:
pytest -m 'not local'
documentation:
jupyter-book clean docs/book
jupyter-book build docs/book
changelog:
build-changelog changelog.yaml --output changelog.yaml --update-last-date --start-from 0.0.0 --append-file changelog_entry.yaml
build-changelog changelog.yaml --org OpenSourceEcon --repo CompMeths --output CHANGELOG.md --template .github/changelog_template.md
bump-version changelog.yaml setup.py
rm changelog_entry.yaml || true
touch changelog_entry.yaml
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,24 @@
# CompMethods
"Computational Methods for Economists using Python", by Richard W. Evans. Tutorials and executable code in Python for the most commonly used computational methods in economics.
# *Computational Methods for Economists using Python*, by Richard W. Evans

| | |
| --- | --- |
| Org | [![OSE Lab cataloged](https://img.shields.io/badge/OSE%20Lab-catalogued-critical)](https://github.com/OpenSourceEcon) [![OS License: AGPL-3.0](https://img.shields.io/badge/OS%20License-AGPL%203.0-yellow)](https://github.com/OpenSourceEcon/CompMethods/blob/main/LICENSE) |
| Package | [![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-31013/) [![PyPI Latest Release](https://img.shields.io/pypi/v/compmethods.svg)](https://pypi.org/project/compmethods/) [![PyPI Downloads](https://img.shields.io/pypi/dm/compmethods.svg?label=PyPI%20downloads)](https://pypi.org/project/compmethods/) |
| Testing | ![example event parameter](https://github.com/OpenSourceEcon/CompMethods/actions/workflows/build_and_test.yml/badge.svg?branch=main) ![example event parameter](https://github.com/OpenSource/CompMethods/actions/workflows/deploy_docs.yml/badge.svg?branch=main) ![example event parameter](https://github.com/OpenSourceEcon/CompMethods/actions/workflows/check_format.yml/badge.svg?branch=main) [![Codecov](https://codecov.io/gh/OpenSourceEcon/CompMethods/branch/main/graph/badge.svg)](https://codecov.io/gh/OpenSourceEcon/compmethods) |

This repository contains the source material, code, and data for the book, [*Computational Methods for Economists using Python*](https://opensourceecon.github.io/CompMethods/), by Richard W. Evans (2023). This book is freely available online as an executable Jupyter Book at [url to book](https://opensourceecon.github.io/CompMethods/).

The materials for the book are constantly being updated. The version number listed in the [Releases](https://github.com/OpenSourceEcon/CompMethods/releases) section of the repository tracks the updates, as well as the [`CHANGELOG.md`](CHANGELOG.md) file.

As an open executable book project, this book is happy to receive, address, and incorporate collaborative additions, corrections, suggestions, and questions. Please see the [Contributor Guide]() in the book for how to best collaborate with the project.

[Richard W. Evans, Phd](https://sites.google.com/site/rickecon) ([@rickecon](https://github.com/rickecon)) is the author of the book and the core maintainer of this repository.

## Citing this book
Please use the following citation form for this book.

General citation to the book:
* Evans, Richard W., *Computational Methods for Economists using Python*, Open access Jupyter Book, v#.#.#, 2023, https://opensourceecon.github.io/CompMethods/.

Citation to a chapter in the book:
* Evans, Richard W., "[insert chapter name]", in *Computational Methods for Economists using Python*, Open access Jupyter Book, v#.#.#, 2023, https://opensourceecon.github.io/CompMethods/[chapter path].
5 changes: 5 additions & 0 deletions changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- changes:
added:
- Created CompMethods repository at GitHub.com/OpenSourceEcon/CompMethods
date: 2023-09-28 17:00:00
version: 0.0.0
1 change: 1 addition & 0 deletions code/placeholder.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
placeholder.txt
1 change: 1 addition & 0 deletions data/placeholder.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Put data here
Empty file added docs/.nojekyll
Empty file.
Binary file added docs/CompMethodsLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/CompMethodsLogo_gitfig.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/CompMethodsLogo_horizontal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/CompMethodsLogo_vertical.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Instructions for files in CompMethods/docs
The files in this directory `CompMethods/docs/` include images and all the files necessary for rendering the Jupyter Book documentation. One image [`CompMethodsLogo_gitfig.png`](docs/CompMethodsLogo_gitfig.png) is only used for the GitHub social preview image. GitHub suggests that this image should be 1280x640px for best display. The image we created [`CompMethodsLogo_horizontal.png`](docs/CompMethodsLogo_horizontal.png) is natively 759x267px. We do the following to resize the image.

1. Open the image in Adobe Photoshop: **File** > **Open**
2. Open the **Image Size** dialogue:
3. Adjust the canvas size: **Image** > **Canvas Size**. Because the 759x276px image is relatively wider than the optimal 1280x640px GitHub size, we first adjust the canvas size. We have to add a little width and some moderate height. So here adjust the canvas width to 760px and then increase the height to half that size 380px.
4. Adjust the image size: **Image** > **Image Size**. Now adjust the image size to the GitHub optimal 1280x640px. The dimesions will be correct and nothing will be stretched.
5. Save the image as [`CompMethodsLogo_gitfig.png`](docs/CompMethodsLogo_gitfig.png).
6. Upload the image [`CompMethodsLogo_gitfig.png`](docs/CompMethodsLogo_gitfig.png) as the GitHub social preview image by clicking on the [**Settings**](https://github.com/OpenSourceEcon/CompMethods/settings) button in the upper-right of the main page of the repository and uploading the formatted image [`CompMethodsLogo_gitfig.png`](docs/CompMethodsLogo_gitfig.png) in the **Social preview** section.
Loading

0 comments on commit 84413e8

Please sign in to comment.