Skip to content

Commit

Permalink
deploy: d5d525d
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhanwei-Liu committed Aug 9, 2024
0 parents commit a9a89bf
Show file tree
Hide file tree
Showing 261 changed files with 53,126 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 93012fddfa5a3b6f48630714d8215644
tags: 645f666f9bcd5a90fca523b33c5a78b7
Empty file added .nojekyll
Empty file.
396 changes: 396 additions & 0 deletions 404.html

Large diffs are not rendered by default.

469 changes: 469 additions & 0 deletions Changelog.html

Large diffs are not rendered by default.

450 changes: 450 additions & 0 deletions Contribution.html

Large diffs are not rendered by default.

411 changes: 411 additions & 0 deletions Forum.html

Large diffs are not rendered by default.

429 changes: 429 additions & 0 deletions Installation.html

Large diffs are not rendered by default.

1,102 changes: 1,102 additions & 0 deletions Mathematical_notations.html

Large diffs are not rendered by default.

834 changes: 834 additions & 0 deletions Model_input_output.html

Large diffs are not rendered by default.

400 changes: 400 additions & 0 deletions References.html

Large diffs are not rendered by default.

419 changes: 419 additions & 0 deletions Tutorial.html

Large diffs are not rendered by default.

Binary file added _images/cost_eq.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 _images/invcost.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 _images/overview.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 _images/typology.jpg
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 _images/varcost.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
398 changes: 398 additions & 0 deletions _modules/index.html

Large diffs are not rendered by default.

520 changes: 520 additions & 0 deletions _modules/prepshot/_model/co2.html

Large diffs are not rendered by default.

757 changes: 757 additions & 0 deletions _modules/prepshot/_model/cost.html

Large diffs are not rendered by default.

465 changes: 465 additions & 0 deletions _modules/prepshot/_model/demand.html

Large diffs are not rendered by default.

586 changes: 586 additions & 0 deletions _modules/prepshot/_model/generation.html

Large diffs are not rendered by default.

608 changes: 608 additions & 0 deletions _modules/prepshot/_model/head_iteration.html

Large diffs are not rendered by default.

932 changes: 932 additions & 0 deletions _modules/prepshot/_model/hydro.html

Large diffs are not rendered by default.

606 changes: 606 additions & 0 deletions _modules/prepshot/_model/investment.html

Large diffs are not rendered by default.

447 changes: 447 additions & 0 deletions _modules/prepshot/_model/nondispatchable.html

Large diffs are not rendered by default.

637 changes: 637 additions & 0 deletions _modules/prepshot/_model/storage.html

Large diffs are not rendered by default.

558 changes: 558 additions & 0 deletions _modules/prepshot/_model/transmission.html

Large diffs are not rendered by default.

617 changes: 617 additions & 0 deletions _modules/prepshot/load_data.html

Large diffs are not rendered by default.

473 changes: 473 additions & 0 deletions _modules/prepshot/logs.html

Large diffs are not rendered by default.

564 changes: 564 additions & 0 deletions _modules/prepshot/model.html

Large diffs are not rendered by default.

604 changes: 604 additions & 0 deletions _modules/prepshot/output_data.html

Large diffs are not rendered by default.

481 changes: 481 additions & 0 deletions _modules/prepshot/set_up.html

Large diffs are not rendered by default.

480 changes: 480 additions & 0 deletions _modules/prepshot/solver.html

Large diffs are not rendered by default.

702 changes: 702 additions & 0 deletions _modules/prepshot/utils.html

Large diffs are not rendered by default.

71 changes: 71 additions & 0 deletions _sources/Changelog.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
Changelog
=========

Here, you'll find notable changes for each version of PREP-SHOT.

Version 0.1.0 - Jun 24, 2024
--------------------------------

* PREP-SHOT model is released with basic functionality for energy expansion planning.
* Linear programming optimization model for energy systems with multiple zones.
* Support for solvers such as Gurobi, CPLEX, MOSEK, and GLPK via `Pyomo <https://pyomo.readthedocs.io/en/stable/solving_pyomo_models.html>`_.
* Input and output handling with `pandas` and `Xarray`.

Version 0.1.1 - Jul 11, 2024
-------------------------------

Added
+++++

* Add an example, expansion of Southeast Asia Mainland power system considering hydropower of Lower Mekong River.
* Update the documentation with a docstring for each function and class.
* Add the `Semantic Versioning Specification <https://semver.org>`_.

Fixed
+++++

Changed
+++++++

* Support for solvers such as GUROBI (Commercial), COPT (Commercial), MOSEK (Commercial), and HiGHS (Open source) via `PyOptInterface <https://github.com/metab0t/PyOptInterface>`_.
* Change default solver to HiGHS.
* Change the code comment style to `NumPy <https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html>`_.
* Change the code style to `PEP8 <https://pep8.org>`_.
* Categorize constraint definitions based on type (co2, cost, demand, generation, hydro, investment, nondispatchable, storage, transmission) for better organization.
* Split `rule.py` class into serveral smaller, focused classes according to categorized constraint definitions.
* Simplify model by replacing intermediate constraints with direct expressions.
* Extract new modules `solver.py`, `output_data.py`, and `set_up.py` from `run.py` and `utils.py`.
* Remove `parameters.py` into `set_up.py`.
* Refactor and improve comments and function names for clarity and conciseness.

Deprecated
++++++++++

* Removed dependency on `Pyomo <https://pyomo.readthedocs.io/en/stable/solving_pyomo_models.html>`_ due to high memory usage and slow performance for large-scale models. `For you reference <https://metab0t.github.io/PyOptInterface/benchmark.html>`_.


Version 0.1.2 - Jul 22, 2024
-------------------------------

Added
++++++

* Added mathematical notations to the constraint module.
* Added a test script for `prepshot.utils`.

Fixed
++++++

* Fixed the format of the API reference.
* Fix code blocks of documentation.
* Updated `Contribution.rst` to include context on running tests and code style checks.
* Defined explicit data types for inputs and outputs of functions for better type checking and readability.
* Added `pyoptinterface._src.core_ext` to Pylint's extension package allow list to resolve cpp-extension-no-member warning.

Changed
++++++++

* Updated `model.py` to keep necessary decision variables and use expressions for intermediate variables instead of direct determination.
* Refactored `extract_results_non_hydro` in `output_data.py` to extract common features for different variables, simplifying the code.
* Removed definitions of complex sets and opted for simple sets wherever possible to streamline the code.
* Refactor: Organize import order of modules according to PEP 8 guidelines: (1) Grouped standard library imports at the top; (2) Followed by third-party library imports; (3) Local application/library imports at the bottom.
74 changes: 74 additions & 0 deletions _sources/Contribution.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
.. _Contribution:

Contribution
=================

We welcome and appreciate contributions for the RPEP-SHOT library. Here are the steps to contribute:

Development Process
+++++++++++++++++++++++++++++++

1. **Create an Issue**

If you find a bug or have an idea for an improvement or new feature, please create an `issue <https://github.com/PREP-NexT/PREP-SHOT/issues>`_.

2. **Fork the Repository**

You can fork the `PREP-SHOT repository <https://github.com/PREP-NexT/PREP-SHOT>`_ on GitHub.

3. **Create a Branch**

Create a new branch in your forked repository and name the branch according to the feature or fix you're working on.

4. **Commit Changes**

Make changes in your branch. Once you've made improvements or bug fixes to the project, commit the changes with a meaningful commit message.

5. **Run Tests**
To execute all tests, navigate to the root directory of PREP-SHOT and run:

.. code:: bash
python -m unittest discover -s tests
To check your code for PEP8 compliance, run:

.. code:: bash
pylint run.py
pylint prepshot
6. **Start a Pull Request**

Open a `pull request <https://github.com/PREP-NexT/PREP-SHOT/pulls>`_ from your forked repository to the main PREP-SHOT repository. Describe your changes in the pull request.

7. **Code Review**

Maintainers of the PREP-SHOT project will review your code. They may ask for changes or improvements before the code is merged into the main codebase.

Please ensure that you update tests as necessary when you're contributing code, and follow the coding conventions established in the rest of the project.

Building Documentation
+++++++++++++++++++++++++++++++

The documentation is built using Sphinx. To build the documentation, you need to install the required packages using the following command:

.. code:: bash
pip install -r docs/requirements.txt
You can build the documentation using the following command:

.. code:: bash
cd doc
make clean
make html
The documentation will be built in the `doc/build` directory.

Contributing Guidelines
+++++++++++++++++++++++++++++++

PREP-SHOT is written in Python and follows the PEP8 coding standard. Please ensure that your code follows the PEP8 coding standard. You can use the `Pylint <https://pylint.readthedocs.io/en/stable/>`_ tool to check your code for PEP8 compliance.
23 changes: 23 additions & 0 deletions _sources/Forum.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. _Forum:

Discussion
==========

We encourage our community to actively participate and engage in discussions. The diverse perspectives and feedback from our users are valuable to us and will help us improve the model and its documentation.

Check out the `FAQ <https://github.com/orgs/PREP-NexT/discussions/15>`_ page for answers to common questions.

GitHub Discussions
------------------

Users can join us for public discussions on the `Discussions <https://github.com/orgs/PREP-NexT/discussions>`_ page in our GitHub repository.

- Ask `questions <https://github.com/orgs/PREP-NexT/discussions/categories/q-a>`_ or seek clarifications.
- Share `ideas <https://github.com/orgs/PREP-NexT/discussions/categories/ideas>`_ or best practices.
- `Showcase <https://github.com/orgs/PREP-NexT/discussions/categories/show-and-tell>`_ how you have used the model for your projects and share your experiences.
- Engage in constructive conversations with our community.

Private Queries
---------------

If you have specific questions, feedback, or topics that are not suitable for public discussions, you may directly reach out to `Zhanwei Liu <mailto:liuzhanwei@u.nus.edu>`_.
61 changes: 61 additions & 0 deletions _sources/Installation.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
.. _Installation:

Installation
============

This page provides instructions on how to install and use PREP-SHOT. The installation process is divided into the following steps:

Step 1: Download PREP-SHOT
++++++++++++++++++++++++++

Ensure you have downloaded the PREP-SHOT model from the `GitHub repository <https://github.com/PREP-NexT/PREP-SHOT>`_.

You may either clone the repository using the command:

.. code-block:: bash
git clone https://github.com/PREP-NexT/PREP-SHOT.git
or download the repository as a zip file `here <https://github.com/PREP-NexT/PREP-SHOT/archive/refs/heads/main.zip>`__.

Step 2: Install dependencies
++++++++++++++++++++++++++++++

Assuming you have already [installed `Python`](https://www.python.org/downloads/), the ``requirements.txt`` file contains all the dependencies for the project (default install open-source solver `HiGHS`). I also recommend [create a new environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) for PREP-SHOT and installing the dependencies within the new environement. This approach isolates the project and its dependencies, helping to prevent conflicts with other Python projects.

.. code:: bash
cd PREP-SHOT
pip install -r requirements.txt
Step 3: Run an example (Optional)
++++++++++++++++++++++++++++++++++

Once the environment is activated, you can run an example of :ref:`Tutorial` with the following command:

.. code:: bash
python run.py
You can also run examples using Jupyter notebooks located in the `./example/` directory.

PREP-SHOT default solve models using open-source solver `HiGHS <https://highs.dev/>`_. also support commercial solvers, including `Gurobi <https://www.gurobi.com/features/academic-named-user-license/>`_, `COPT <https://www.copt.de/>`_ and `MOSEK <https://www.mosek.com/>`_. They offer academic licenses. To use these solvers, you need to install them and modify the solver in the `config.json` file.


Step 4: Run your own model
+++++++++++++++++++++++++++

You can prepare your input data referring to the example in the `input` and `southeast` folder. The detailed input data are introduced in the :ref:`Tutorial`. After preparing the input data, you can modify the `config.json` file to set the solver and other parameters. Then you can run your model with the following command:

.. code:: bash
python run.py
Loading

0 comments on commit a9a89bf

Please sign in to comment.