Giter VIP home page Giter VIP logo

gdplib's Introduction

GDPlib

We envision GDPlib as an open library of GDP models to provide examples for prospective modelers, and to provide a benchmarking set for algorithm developers. We invite contributions to this library from the community, provided under the same BSD-3-clause or compatible license.

Installation

GDPlib is an installable model library in Python. To install GDPlib, you can use:

pip install gdplib

To update GDPlib:

pip install --upgrade gdplib

For a developer install, please clone this repository, activate the correct python environment, and run python setup.py develop on the setup.py file in this directory.

Model descriptions

Details for each model are given in a separate README.md file in each directory. Navigate to these directories to read the files.

Using this library

Once GDPlib is installed, functions for constructing the desired models can be imported from each of the main subpackages. For example, biofuel/__init__.py exposes a build_model function, allowing the user to write the following:

from gdplib.biofuel import build_model as build_biofuel_model
pyomo_model = build_biofuel_model()

Adding models to the library

To add new models to the library, the following steps should be taken:

  1. Ensure that you have the requisite permissions to contribute the model to an open source library.
  2. Add your files into one of the existing directories or a new project directory: gdplib/mynewmodel.
  3. If a new directory is created, add the corresponding import to gdplib/__init__.py.
  4. Within your project directory, add the requisite imports and edits to the __all__ statement in gdplib/mynewmodel/__init__.py to expose the appropriate build functions. See the other project directories for examples.
  5. Within your project directory, create a README.md file describing the new model.

Directories are free to implement their own subpackages.

Relative vs. absolute imports

Note that __main__ scripts within projects (i.e. those that you plan to execute directly) will need to use absolute imports rather than relative imports. For example, in gdplib/gdp_col/main.py, we need to write from gdplib.gdp_col.fenske import calculate_Fenske rather than from .fenske import calculate_Fenske.

gdplib's People

Contributors

bernalde avatar emma58 avatar qtothec avatar yunshan-liu avatar yunshanl 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.