Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abcesl #5

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
# python-distilledESL
# ABCESL

[![DOI](https://zenodo.org/badge/95235014.svg)](https://zenodo.org/badge/latestdoi/95235014)
[![Build Status](https://travis-ci.org/rht/py-distilledESL.svg?branch=master)](https://travis-ci.org/rht/py-distilledESL)


This is a python port of the entirety of
https://github.com/EconomicSL/distilledESL, further trimmed to its essence.
`distilledESL` is a rewrite of Core-ESL, a reference implementation of Economic
It is a plugin to [ABCE](https://github.com/AB-CE/abce);
`ABCESL` is a reference implementation of Economic
Simulation Library. I anticipate that the spec for the EconomicSL library will
be cross-language, just like in the case of a spec of an IETF RFC.

Currently it has a feature and implementation parity with:
https://github.com/EconomicSL/distilledESL/commit/1ef2d0a9fed490990f2a600b2916391de50bdea8 (May 10 2017)

The goal of this repo is to become a catalyst for a convergent evolution between the
API designs in Core-ESL / distilled-ESL / ABCE. Ideas can be tested much more
API designs distilled-ESL / ABCE. Ideas can be tested much more
easily here.

While the ABCESL is currently used in Oxford for our stress testing model,
it is sparsely documented and lacks behavioral and unit tests. This is in
sharp contrast to ABCE, which has a good documentation and a test coverage
of all essential functions.

## Installation

This library uses Python >=3.5 type system, so it runs only on python>=3.5.

To install, run
```
$ pip install git+https://github.com/rht/py-distilledESL
$ pip install git+https://github.com/AB-CE/ABCESL.git
```

or from this repo
Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python3 -msphinx
SPHINXPROJ = abcESL
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
8 changes: 8 additions & 0 deletions docs/account.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Account
=======

.. automodule:: economicsl.accounttype

.. automodule:: economicsl.account
:members:
:show-inheritance:
Empty file added docs/action.rst
Empty file.
6 changes: 6 additions & 0 deletions docs/agent.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
abcesl.Agent
============

.. automodule:: economicsl.agent
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/bankersrounding.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bankersrounding
===============

.. automodule:: economicsl.bankersrounding
:members:
:show-inheritance:
172 changes: 172 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# abcESL documentation build configuration file, created by
# sphinx-quickstart on Wed Sep 6 20:33:17 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'abcESL'
copyright = '2017, Rudy Tanin, Davoud Taghawi-Nejad, Alissa Kleinnijenhuis, Thom Wetzer'
author = 'R. Tanin, D. Taghawi-Nejad, A. Kleinnijenhuis, T. Wetzer, D. Farmer'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1'
# The full version, including alpha/beta/rc tags.
release = '0.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False


# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
'**': [
'about.html',
'navigation.html',
'relations.html', # needs 'show_related': True theme option to display
'searchbox.html',
'donate.html',
]
}


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'abcESLdoc'


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'abcESL.tex', 'abcESL Documentation',
'R. Tanin, D. Taghawi-Nejad, A. Kleinnijenhuis, T. Wetzer, D. Farmer', 'manual'),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'abcesl', 'abcESL Documentation',
[author], 1)
]


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'abcESL', 'abcESL Documentation',
author, 'abcESL', 'One line description of project.',
'Miscellaneous'),
]



6 changes: 6 additions & 0 deletions docs/contract.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Contract
========

.. automodule:: economicsl.contract
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/contracting.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Contracting
===========

.. automodule:: abce.contracts.flexiblecontracting
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/exception.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Exception
=========

.. autoexception:: abce.NotEnoughGoods
:members:
:show-inheritance:
52 changes: 52 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.. abcESL documentation master file, created by
sphinx-quickstart on Wed Sep 6 20:33:17 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Welcome to abcESL's documentation!
==================================

Introduction
------------

ABCESL is an accounting and contracting framework for ABCE. It was originally developed by
Rafa Babtista, Alissa Kleinnijenhuis and Thom Wetzer and subsequently distilled and refined by
Rudy Tanin, Davoud Taghawi-Nejad. Originally it was conceived as a framework to run
systemic stress testing exercises for the financial sector.
Currently it is used in the resilience project as well as in an insurance modeling
project.

In order to install abcesl, first install ABCE (abce.readthedocs.io) and then
install :code:`sudo python3 -m pip install abcesl` or
:code:`sudo pypy3 -m pip install abcesl`.

You can than create agents that inherit from abcesl.Agent instead of abce.Agent.
Like abce agents these agents have an inventory of goods :code:`self['cookies']`,
but they also have an inventory of contracts and set of accounts that book the
values of goods and contracts.

ABCESL is part of the wider effort of the Economic Simulation Library at
the Institute for New Economic Thinking at Oxford University.


.. toctree::
:maxdepth: 2
:caption: Contents:


agent
ledger
account
contract
contracting
obligations
obligationmessage
exception


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
10 changes: 10 additions & 0 deletions docs/ledger.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Ledger
======

.. automodule:: economicsl.ledger

.. autoclass:: economicsl.ledger.Ledger
:members:
:show-inheritance:


6 changes: 6 additions & 0 deletions docs/obligationmessage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ObligationsMessage
==================

.. automodule:: economicsl.obligationmessage
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/obligations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Obligations
===========

.. automodule:: economicsl.obligations
:members:
:show-inheritance:
Loading