REopt Scenario Analysis is a Julia-based tool for analyzing and visualizing REopt scenarios. It provides functionalities for running scenarios, plotting results, and performing various data analyses related to renewable energy systems.
- Run and analyze multiple REopt scenarios
- Generate visualizations for scenario comparisons
- Perform load scaling and adjustments
- Create grouped bar plots for easy data interpretation
- Flexible data extraction and manipulation
-
Clone this repository:
git clone https://github.com/bpulluta/REopt-Scenario-Analysis.git cd REopt-Scenario-Analysis
-
Run the setup script to install all required packages:
julia setup.jl
This script will install all necessary dependencies and precompile them.
Note: You need to have Julia installed on your system. This project was developed with Julia 1.6+.
-
Install Jupyter if you haven't already. You can do this via pip:
pip install jupyter
-
Install the Julia kernel for Jupyter:
using Pkg Pkg.add("IJulia")
REopt-Scenario-Analysis/
├── src/
│ ├── reopt_runscenarios.jl
│ ├── reopt_plotting.jl
│ ├── reopt_load_scaling.jl
│ ├── reopt_groupedbarplot.jl
│ └── reopt_getdata.jl
├── ScenarioAnalysis/
│ └── REoptScenarioAnalysis.ipynb
├── examples/
├── projects/
│ └── [Your project folders will be created here]
├── setup.jl
├── .gitignore
└── README.md
-
Launch Jupyter Notebook:
jupyter notebook
-
Navigate to and open
REoptScenarioAnalysis.ipynb
in theScenarioAnalysis
folder. -
The notebook contains all the code to run the analysis. Key configuration variables include:
BASE_PATH
: Set to "../projects/" by default. This is where your project directories will be created.SITE_NAME
: Set this to your preferred site name. A directory with this name will be created underBASE_PATH
.RUN_NEW_ANALYSIS
: Set totrue
to run a fresh analysis, orfalse
to load the latest saved results.
-
Prepare your scenario JSON files:
- Create a JSON file named
[SITE_NAME]_scenarios.json
in your site's directory underprojects/
. - Structure your JSON like this:
{ "SITE_NAME": { "case1": [ ["scenarios/scenario1.json", "Scenario 1 Name"], ["scenarios/scenario2.json", "Scenario 2 Name"] ], "case2": [ ["scenarios/scenario3.json", "Scenario 3 Name"], ["scenarios/scenario4.json", "Scenario 4 Name"] ] } }
- Create a JSON file named
-
Run the notebook:
- Execute the cells in order to set up the environment, load your scenarios, and run the analysis.
- The notebook will either run a new analysis or load existing results based on the
RUN_NEW_ANALYSIS
setting. - Results will be saved in a versioned directory under your site's folder.
-
After running, you can access the results through the
all_results
dictionary, where each key is a case and the value is a tuple of(reoptsim_results, results)
.
reopt_runscenarios.jl
: Handles the execution of REopt scenarios and result collection.reopt_plotting.jl
: Contains functions for creating various plots and visualizations.reopt_load_scaling.jl
: Provides utilities for load adjustment and scaling.reopt_groupedbarplot.jl
: Implements functionality for creating grouped bar plots.reopt_getdata.jl
: Offers tools for data extraction and manipulation from REopt results.
We welcome contributions to the REopt Scenario Analysis project! Here are some ways you can contribute:
- Report bugs or request features by opening an issue.
- Improve documentation and examples.
- Submit pull requests with bug fixes or new features.
Please ensure that your code adheres to the existing style and that all tests pass before submitting a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
- This project uses the REopt Julia Package developed by NREL.
- Thanks to all contributors who have helped shape this project.
For any questions or feedback, please open an issue on this GitHub repository.