Skip to content

Commit

Permalink
Enable docs build on ReadTheDocs (#154)
Browse files Browse the repository at this point in the history
* add ixmp to requirements for docs build environment

* try to locate grab_gams_doc on RTD

* add .readthedocs.yml to force Python 3.6

* require sphinx >= 1.8

* fix 'duplicate explicit target name' in tutorial/README.rst

* locate grab_gams_doc sources relative to conf.py

* update release notes

* switch to RTD theme for Sphinx

* simplify redundancies for clean ToC on RTD

* improve grab_gams_doc to add source location

* discard hard-coded source locations in .gms files

* tweak titles

* add IIASA white logo & change sidebar background

* adjust notice phrasing & emphasis

* also change background colour on mobile layout to IIASA blue

* use IIASA colours for sidebar

* further use IIASA colours

* change to purple on blue
  • Loading branch information
khaeru authored and gidden committed Feb 22, 2019
1 parent b36f11b commit 8cd9237
Show file tree
Hide file tree
Showing 53 changed files with 443 additions and 3,554 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Expand Up @@ -30,8 +30,9 @@ message_ix/model/MESSAGE_master.gms
.DS_Store

# local version of auto-documentation features
/doc/build/**
/doc/source/model/**
doc/build
doc/source/_build
doc/source/model

# files generated during install
ixmp/default_paths.py
Expand Down
6 changes: 6 additions & 0 deletions .readthedocs.yml
@@ -0,0 +1,6 @@
build:
image: latest

python:
version: 3.6
setup_py_install: true
43 changes: 26 additions & 17 deletions CONTRIBUTING.rst
@@ -1,26 +1,35 @@
Contributor Guidelines
======================
Contributing to |MESSAGEix| development
=======================================

We appreciate contributions to the code base and development of new features for the framework. Please `open a new “issue” on Github <https://github.com/iiasa/message_ix/issues/new>`_ to raise questions concerning potential bugs or to propose new features. `Existing open and resolved/closed issues <https://github.com/iiasa/message_ix/issues?q=is:issue>`_ may already contain a solution.
We appreciate contributions to the code base and development of new features for the framework.
Please `open a new issue on Github <https://github.com/iiasa/message_ix/issues/new>`_ to raise questions concerning potential bugs or to propose new features.
`Existing open and resolved/closed issues <https://github.com/iiasa/message_ix/issues?q=is:issue>`_ may already contain a solution.

For contributions to the code base of the platform, please `open a GitHub “pull request,” <https://github.com/iiasa/message_ix/pulls>`_ including a detailed description of the new feature and unit tests to illustrate the intended functionality. All pull requests will be reviewed by the message_ix maintainers and/or contributors.
For contributions to the code base of the platform, please `open a GitHub “pull request,” <https://github.com/iiasa/message_ix/pulls>`_ including a detailed description of the new feature and unit tests to illustrate the intended functionality.
All pull requests will be reviewed by the message_ix maintainers and/or contributors.

Contributors are required to sign the `Contributor License Agreement`_
before any pull request can be reviewed. This ensures that all future users can benefit
from your contribution, and that your contributions do not infringe on anyone else's rights.
Contributors are required to sign the `Contributor License Agreement`_ before any pull request can be reviewed.
This ensures that all future users can benefit from your contribution, and that your contributions do not infringe on anyone else's rights.
The electronic signature is collected via the `cla-assistant`_ when issuing the pull request.

Code submitted via pull requests must adhere to the following style formats:
Coding style
------------

- Python: `pep8`_
- R: please follow the style of the existing code base
- Jupyter notebooks: commit 'bare' notebooks, with no cell output. Notebooks
will be run and rendered when the documentation is generated.
- other (file names, CLI, etc.): please follow the style of the existing code
base
Code submitted via pull requests must adhere to the following style:

.. _`Contributor License Agreement`: contributor_license.html
- Python: follow `PEP 8`_.
- R: follow the style of the existing code base.
- Jupyter notebooks (``.ipynb``):

- Commit 'bare' notebooks, with no cell output.
Notebooks will be run and rendered when the documentation is generated.

- Documentation (``.rst``, ``.md``):

.. _`cla-assistant` : https://github.com/cla-assistant/
- Do not hard-wrap lines. Start each sentence on a new line.

.. _`pep8`: https://www.python.org/dev/peps/pep-0008/
- Other (file names, CLI, etc.): follow the style of the existing code base.

.. _`Contributor License Agreement`: contributor_license.html
.. _`cla-assistant`: https://github.com/cla-assistant/
.. _`PEP 8`: https://www.python.org/dev/peps/pep-0008/
30 changes: 10 additions & 20 deletions CONTRIBUTOR_LICENSE.rst
Expand Up @@ -4,23 +4,14 @@ Contributor License Agreement
Summary and scope
-----------------

It may seem self-evident that contributing to a project
distributed under an open-source license
is an implicit permission to anyone for using the contributed code.
However, a formal Contributor License Agreements (CLA)
makes contribution terms explicit and provides the project maintainers
a record of your agreement to those terms.

A wide range of terms exist in other CLAs, including waiver of moral rights,
consequential damages waiver, as-is disclaimer, etc.
For this project, we follow the more bare-boned GitHub CLA,
which focuses on the three most important clauses:
copyright, patent, and source of contribution.
It may seem self-evident that contributing to a project distributed under an open-source license is an implicit permission to anyone for using the contributed code.
However, a formal Contributor License Agreements (CLA) makes contribution terms explicit and provides the project maintainers a record of your agreement to those terms.

A wide range of terms exist in other CLAs, including waiver of moral rights, consequential damages waiver, as-is disclaimer, etc. For this project, we follow the more bare-boned GitHub CLA, which focuses on the three most important clauses: copyright, patent, and source of contribution.

In short, by signing this Contributor License Agreement, you confirm that:

1. Anyone can use your contributions anywhere, for free, forever.

2. Your contributions do not infringe on anyone else's rights.


Expand All @@ -30,9 +21,9 @@ Definition of terms
The following terms are used throughout this agreement:

- **You** - the person or legal entity including its affiliates asked
to accept this agreement. An affiliate is any entity that controls
to accept this agreement. An affiliate is any entity that controls
or is controlled by the legal entity, or is under common control with it.
- **Project** - the repositories ``message_ix`` and ``ixmp``, and
- **Project** - the repositories ``message_ix`` and ``ixmp``, and
any derived repositories, projects, or software/code packages.
- **Contribution** - any type of work that is submitted to a Project,
including any modifications or additions to existing work.
Expand All @@ -45,7 +36,7 @@ The following terms are used throughout this agreement:

Subject to the terms and conditions of this agreement, You grant to
the Projects’ maintainers, contributors and users a perpetual, worldwide,
unlimited in scope, non-exclusive, no-charge, royalty-free, irrevocable
unlimited in scope, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to, in particular without being limited to,
reproduce, prepare derivative works of, publicly display, make available,
sublicense, and distribute Your contributions and such derivative works
Expand Down Expand Up @@ -92,10 +83,9 @@ for damages that may arise.
Reference and License
---------------------

This Contributor License Agreement and the introductory text is adapted from
This Contributor License Agreement and the introductory text is adapted from
the `GitHub Contributor License Agreement`_, Version 298f3afd updated August 9, 2017.
GitHub granted a `CC-BY-4.0 License`_ to IIASA to use and modify the text of the CLA.

.. _`GitHub Contributor License Agreement` : https://cla.github.com/agreement
.. _`CC-BY-4.0 License` : https://creativecommons.org/licenses/by/4.0/
.. _`GitHub Contributor License Agreement`: https://cla.github.com/agreement
.. _`CC-BY-4.0 License`: https://creativecommons.org/licenses/by/4.0/
22 changes: 10 additions & 12 deletions INSTALL.rst
@@ -1,34 +1,32 @@
Installation
============

|MESSAGEix| requires `GAMS`_. After installing GAMS, we recommend that new
users install Anaconda, and then use it to install |MESSAGEix|. Advanced users
may choose to install |MESSAGEix| from source code.
Install GAMS
------------

Installing GAMS
---------------
|MESSAGEix| requires `GAMS`_.

1. Download the latest version of `GAMS`_ for your operating system; run the
installer.

2. Add GAMS to the ``PATH`` environment variable. This is **required** in order
for |MESSAGEix| to run the mathematical model core:

- on Windows, in the GAMS installer:
- on Windows, in the GAMS installer
- Check the box labeled “Use advanced installation mode.”
- Check the box labeled “Add GAMS directory to PATH environment variable”
on the Advanced Options page.
- on macOS or Linux:
- Add the following line to your ``.bash_profile`` (Mac) or ``.bashrc`` (Linux)

```
export PATH=$PATH:/path/to/gams-directory-with-gams-binary
```
- on macOS or Linux, add the following line to your ``.bash_profile`` (Mac) or ``.bashrc`` (Linux)::

export PATH=$PATH:/path/to/gams-directory-with-gams-binary

Install |MESSAGEix| via Anaconda
--------------------------------

After installing GAMS, we recommend that new users install Anaconda, and then
use it to install |MESSAGEix|. Advanced users may choose to install |MESSAGEix|
from source code (next section).

3. Install Python via `Anaconda`_. We recommend the latest version, i.e.,
Python 3.6+.

Expand Down
97 changes: 34 additions & 63 deletions NOTICE.rst
@@ -1,100 +1,71 @@
User Guidelines and Notice
User guidelines and notice
==========================

Copyright 2018 IIASA Energy Program
We ask that you take the following four actions whenever you:

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
- **use** the |MESSAGEix| framework, |ixmp|, or any model(s) you have built using these tools
- to **produce** any scientific publication, technical report, website, or other **publicly-available material**.

http://www.apache.org/licenses/LICENSE-2.0
The aim of this request is to ensure good scientific practice and collaborative development of the platform.

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
1. Understand the code license
------------------------------

Use the most recent version of |MESSAGEix| from the Github repository.
Specify clearly which version (e.g. release tag, such as ``v1.1.0``, or commit hash, such as ``26cc08f``) you have used, and whether you have made any modifications to the code.

Introduction
------------
Read and understand the file ``LICENSE``; in particular, clause 7 (“Disclaimer of Warranty”), which states:

This document specifies the guidelines for using the |MESSAGEix| framework and the ix modeling platform.
The aim of these guidelines is to ensure best scientific practice and collaborative development of the platform.
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.

Documentation and further information is available at `MESSAGEix.iiasa.ac.at`_.
The framework is available for download at `github.com/iiasa/message_ix`_.
Please refer to the website and repository for the most up-to-date version of the code base.

The community mailing list for questions and discussions on new features is hosted using Googlegroups.
Please join at `groups.google.com/d/forum/message_ix`_
and use <message_ix@googlegroups.com> to send an email to the |MESSAGEix| user community.
2. Cite the scientific publication
----------------------------------

.. _`MESSAGEix.iiasa.ac.at` : http://MESSAGEix.iiasa.ac.at
.. _`github.com/iiasa/message_ix`: http://www.github.com/iiasa/message_ix

.. _`groups.google.com/d/forum/message_ix` : https://groups.google.com/d/forum/message_ix
User Guidelines
---------------

A) Reference to the scientific publication and online resources
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Please cite the following manuscript when using the |MESSAGEix| framework and/or the ix modeling platform
for scientific publications or technical reports:
Cite the following manuscript:

| Daniel Huppmann, Matthew Gidden, Oliver Fricko, Peter Kolp, Clara Orthofer,
Michael Pimmer, Nikolay Kushin, Adriano Vinca, Alessio Mastrucci,
Keywan Riahi, and Volker Krey.
| "The MESSAGEix Integrated Assessment Model and the ix modeling platform".
| *Environmental Modelling & Software* 112:143-156, 2019.
| *Environmental Modelling & Software* 112:143-156, 2019.
| doi: `10.1016/j.envsoft.2018.11.012`_
| electronic pre-print available at `pure.iiasa.ac.at/15157/`_.
Also, please include a hyperlink to the online resource `MESSAGEix.iiasa.ac.at`_
in any publication/report, or on a website describing your model
or scientific analysis using the MESSAGEix framework.

.. _`10.1016/j.envsoft.2018.11.012` : https://doi.org/10.1016/j.envsoft.2018.11.012
.. _`pure.iiasa.ac.at/15157/` : https://pure.iiasa.ac.at/15157/
In addition, include a hyperlink to the online resource `MESSAGEix.iiasa.ac.at`_.

B) Developing new model instances
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Researchers are welcome to develop new model instances using the |MESSAGEix| framework
for their own research interests. However, any such model must be named "MESSAGEix xxx" or "MESSAGEix-xxx",
where 'xxx' is replaced by the name of the country/region, institutional affiliation or a similar identifying name.
For example, the national model for South Africa developed by Orthofer et al. [1] is called "MESSAGEix South Africa".
3. Use the naming convention for new model instances
----------------------------------------------------

Furthermore, please ensure that there is no naming conflict with existing versions of the |MESSAGEix| model family.
When in doubt, please contact the IIASA Energy Program at <message_ix@iiasa.ac.at>.
For any new model instance under the |MESSAGEix| framework, choose a name of
the form "MESSAGEix [xxx]" or "MESSAGEix-[xxx]", where [xxx] is replaced by:

C) Notice of new publications
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- the institution or organization developing the model,
- the name of a country/region represented in the model, or
- a similar identifier.

We would appreciate a notice of publications using the |MESSAGEix| framework and the ix modeling platform.
Please send an e-mail to <message_ix@iiasa.ac.at>.
For example, the national model for South Africa developed by Orthofer et al. [1] is named "MESSAGEix South Africa".

Ensure there is no naming conflict with existing versions of the |MESSAGEix| model family.
When in doubt, contact the IIASA Energy Program at <message_ix@iiasa.ac.at> for a list of existing model instances.

Contributor Guidelines
----------------------

We appreciate contributions to the code base and development of new features for the framework.
Please refer to `Contributor Guidelines`_ for details.
4. Give notice of publication
-----------------------------

.. _`Contributor Guidelines` : contributing.html
E-mail <message_ix@iiasa.ac.at> with notice of notice of any new or pending publication.


References
----------

[1] | Clara Orthofer, Daniel Huppmann, and Volker Krey.
| "South Africa's shale gas resources - chance or challenge?"
| 2018, submitted.
| 2018, submitted.
electronic pre-print available at `pure.iiasa.ac.at/15085/`_
.. _`pure.iiasa.ac.at/15085/` : https://pure.iiasa.ac.at/15085/
.. _`10.1016/j.envsoft.2018.11.012`: https://doi.org/10.1016/j.envsoft.2018.11.012
.. _`pure.iiasa.ac.at/15157/`: https://pure.iiasa.ac.at/15157/
.. _`MESSAGEix.iiasa.ac.at`: https://MESSAGEix.iiasa.ac.at/
.. _`pure.iiasa.ac.at/15085/`: https://pure.iiasa.ac.at/15085/
12 changes: 5 additions & 7 deletions README.md
Expand Up @@ -21,13 +21,15 @@ a data warehouse for high-powered numerical scenario analysis.

## License

Copyright © 2018 IIASA Energy Program
Copyright © 2018–2019 IIASA Energy Program

The MESSAGEix framework is licensed under the Apache License, Version 2.0 (the
"License"); you may not use the files in this repository except in compliance
with the License. You may obtain a copy of the License at
with the License. You may obtain a copy of the License at
<http://www.apache.org/licenses/LICENSE-2.0>.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Please refer to the [NOTICE](NOTICE.rst) for details and user guidelines.


Expand All @@ -41,11 +43,7 @@ automatically created from mark-up comments in the GAMS, Python, and R code.
The online documentation is synchronized with the contents of the master branch
of the [message_ix Github repository](http://www.github.com/iiasa/message_ix).

For offline use, the documentation can be built from the source code. Navigate
to the `doc` folder and in a command prompt type:

$ make doc

For offline use, the documentation can be built from the source code.
See `doc/README.md` for further details.


Expand Down
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
@@ -1,6 +1,7 @@

# Next Release

- [#154](https://github.com/iiasa/message_ix/pull/154): Enable documentation build on ReadTheDocs.
- [#138](https://github.com/iiasa/message_ix/pull/138): Update documentation and tutorials.
- [#131](https://github.com/iiasa/message_ix/pull/131): Update clone function syntax scen to scenario

Expand Down
39 changes: 0 additions & 39 deletions doc/README.md

This file was deleted.

0 comments on commit 8cd9237

Please sign in to comment.