Getting started
!!! info “Overview”
Prerequisites:
- AMPL must be installed first and be accessible from your system’s PATH.
- Python 3.6 or higher is required.
Installation Paths:
- Option A: Quick Start for Beginners 😎
- Install EnergyScope via pip
.
- Ideal for users who want a simple setup without modifying the source code.
- Option B: Editable Installation for Experts 🏄
- Clone the EnergyScope repository and install in editable mode.
- Suitable for users who plan to modify the source code or AMPL models.
Welcome to the EnergyScope library! This guide will help you set up and start using EnergyScope, whether you’re a beginner looking to run simulations or an expert aiming to modify the source code.
Prerequisites¤
Before you begin, please ensure you have the following:
- Install AMPL EnergyScope relies on AMPL (A Mathematical Programming Language) for optimization modeling. AMPL must be installed first and be accessible from your system’s PATH.
-
See the Installing AMPL section below for detailed instructions.
-
Python
- Version: Python 3.6 or higher.
- Environment: We recommend using a virtual environment to manage dependencies.
Choose Your Path¤
Option A: Quick Start for Beginners 😎¤
If you’re new to EnergyScope and want a quick setup without delving into the source code: 1. Install EnergyScope via pip:
pip install energyscope
Option B: Editable Installation for Experts 🏄¤
If you plan to customize the source code or the underlying AMPL models: 1. Clone the EnergyScope Repository:
git clone https://gitlab.com/energyscope/energyscope.git
cd energyscope
pip install -e .
# Clone the repository
!git clone git@gitlab.com:energyscope/energyscope.git
# Install the package in editable mode
%pip install -e ./energyscope
# Add the package to the Python path (if necessary)
import sys
sys.path.append('./energyscope')
Installing AMPL¤
EnergyScope uses AMPL for optimization modeling. Follow these steps to install AMPL on your system:
- Download AMPL
- Visit the AMPL Community Edition ⧉ page to download the appropriate version for your operating system.
- Install AMPL
- Windows:
- Run the installer and follow the on-screen instructions.
- Linux and macOS:
- Extract the downloaded archive to a directory where you have read and write permissions (e.g., your home directory).
- Activate Your License
- AMPL Community Edition requires a free license.
- During installation, you’ll receive a license UUID.
- Activate your license by running the following command in the AMPL command prompt:
Replace
shell "amplkey activate --uuid <license-uuid>";
<license-uuid>
with your actual license UUID. - Note: Restart AMPL after activation to start using the new license.
- Add AMPL to PATH
- Windows:
- Add the AMPL installation directory (e.g.,
C:\AMPL
) to your system’s PATH environment variable.
- Add the AMPL installation directory (e.g.,
- Linux and macOS:
- Open your terminal and add the following line to your .bashrc or .bash_profile:
export PATH="/path/to/ampl:$PATH"
- Open your terminal and add the following line to your .bashrc or .bash_profile:
- Replace /path/to/ampl with the actual path to your AMPL directory.
- Verify AMPL Installation To confirm that AMPL is correctly installed:
- Open Command Prompt or Terminal:
- Open a new command prompt (Windows) or terminal window (Linux/macOS).
- Run AMPL:
ampl
- If installed correctly, you should see the
ampl:
prompt you can quit with the commandquit;
- If installed correctly, you should see the
Running EnergyScope¤
With both EnergyScope and AMPL installed, you’re ready to run simulations. - Basic Tutorial: - Start with the Basic Run Tutorial to learn how to set up and execute a basic energy model.
Need Help?
If you have any questions or run into issues: - Documentation: Check out the EnergyScope Documentation. - Community Support: Join our community ⧉ forum for discussions and help. - Contact Us: Reach out via our contact page ⧉.