Skip to content

Commit

Permalink
update installation steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhanwei-Liu committed Sep 5, 2023
1 parent 872993d commit 39773c9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 158 deletions.
119 changes: 12 additions & 107 deletions doc/source/Installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
Installation
============

This page provides instructions on how to install PREP-SHOT.

Standard Installation
----------------------

For users installing on a local machine or server.
This page provides instructions on how to install and use PREP-SHOT. The installation process is divided into the following steps:

Step 1: Install Gurobi
++++++++++++++++++++++
Expand All @@ -22,123 +17,33 @@ Miniconda is a package management tool that helps manage the Python packages req

To verify that Miniconda has been installed successfully, you can run the ``conda -V`` command to check its version.

Step 3: Create the Conda Environment
++++++++++++++++++++++++++++++++++++

The ``prep-shot.yml`` file contains all the dependencies for the project. You can use it to create a new environment for PREP-SHOT. This environment isolates the project and its dependencies from other Python projects to prevent package conflicts.

.. code:: bash
conda env create -f prep-shot.yml
conda activate prep-shot
Step 4: Run the Model
+++++++++++++++++++++

Once the environment is activated, you can run your program with the following command:
Step 3: Download PREP-SHOT
++++++++++++++++++++++++++

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

Installation on HPC Systems
----------------------------
You may either clone the repository using the command:

For users installing PREP-SHOT on a High-Performance Computing (HPC) system.
.. code-block:: bash
Step 1: Load Gurobi
+++++++++++++++++++
git clone https://github.com/PREP-NexT/PREP-SHOT.git
For users on the High-Performance Computing (HPC) system at the National University of Singapore (NUS), Gurobi is already installed. You can load it with the following commands:
or download the repository as a zip file `here <https://github.com/PREP-NexT/PREP-SHOT/archive/refs/heads/main.zip>`__.

.. code:: bash
module avail Gurobi
module load Gurobi/9.5.1
Step 2: Load Miniconda
++++++++++++++++++++++

For users on the HPC system, Miniconda is typically already installed. You can load it with the following commands:

.. code:: bash
module avail miniconda
module load miniconda/4.12
Step 3: Create the Conda Environment
Step 4: Create the Conda Environment
++++++++++++++++++++++++++++++++++++

Similar to the standard installation, use the ``prep-shot.yml`` file to create a new environment for PREP-SHOT.
The ``prep-shot.yml`` file contains all the dependencies for the project. You can use it to create a new environment for PREP-SHOT. This environment isolates the project and its dependencies from other Python projects to prevent package conflicts.

.. code:: bash
conda env create -f prep-shot.yml
conda activate prep-shot
Step 4: Run the Model
+++++++++++++++++++++

For HPC users, you need to create a bash script file (e.g., ``prep-shot-1.sh``) to submit your job to the HPC cloud.

.. code:: bash
#PBS -N PREP-SHOT-1
#PBS -l select=1:ncpus=24:mem=120gb
#PBS -q parallel24
#PBS -l walltime=240:0:0
#PBS -o ./log/prep-shot-1.out
#PBS -e ./log/prep-shot-1.err
cd ${PBS_O_WORKDIR}
np=$(cat ${PBS_NODEFILE} | wc -l)
source /etc/profile.d/rec_modules.sh
bash ~/.bashrc
module load miniconda/4.12
module load Gurobi/9.5.1
source activate prep-shot
$CONDA_PREFIX/bin/python run.py
To submit your job, use the following command:

.. code:: bash
qsub prep-shot-1.sh
Manual Installation
-------------------

For users who prefer to manually install Python packages.

Step 1: Install Python
++++++++++++++++++++++

Ensure Python 3.7 is installed on your machine. You can download Python 3.7 from the official Python `website <https://www.python.org/downloads/release/python-370/>`_.

Step 2: Install Gurobi
++++++++++++++++++++++

Gurobi is an optimization solver known for its speed and efficiency. You can obtain a free academic license by following `Gurobi Instructions <https://www.gurobi.com/features/academic-named-user-license/>`_.

Step 3: Install Packages
++++++++++++++++++++++++

You can manually install each package using pip, Python's package installer. Execute the following commands:

.. code:: bash
pip install gurobipy==9.5.1
pip install numpy==1.21.6
pip install openpyxl==3.0.9
pip install pandas==1.3.5
pip install pyomo==6.4.0
pip install scipy==1.7.3
pip install xarray==0.20.2
Step 4: Run the Model
Step 5: Run the Model
+++++++++++++++++++++

Once all the packages are installed, you can run your program with the following command:
Once the environment is activated, you can run an example with the following command:

.. code:: bash
Expand Down
51 changes: 0 additions & 51 deletions doc/source/Tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,54 +32,3 @@ However, we will be exploring the potential of incorporating four additional tec
* Energy storage plants

The objective of our scenario is to devise an electric mix pathway from 2020 to 2030 that enables the achievement of zero-carbon emissions. We shall use a 48-hour period as a representative sample for our analysis.

Run the Model
-------------

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: Create the Conda Environment
++++++++++++++++++++++++++++++++++++

Navigate to the root directory of the PREP-SHOT model and create a conda environment with the required packages:

.. code-block:: bash
conda env create -f prep-shot.yml
Activate the newly-created conda environment:

.. code-block:: bash
conda activate prep-shot
Step 3: Download Input Files
++++++++++++++++++++++++++++

If you have followed the instructions in Step 1, you may omit this step, as the input files for this tutorial are already included in the repository.

Otherwise, download the input files for this tutorial from `here <./_static/input.zip>`__.

Extract the contents of the zip file and place all the data files *(in .xlsx)* into the ``input`` folder of the PREP-SHOT model.

.. note:: The ``input`` folder will be used to store all input files *(in .xlsx)* for the model to run your scenarios.

Step 4: Run the Model
+++++++++++++++++++++

Finally, launch the model by running the following command in the root directory of the PREP-SHOT model.

.. code-block:: bash
python run.py

0 comments on commit 39773c9

Please sign in to comment.