Skip to content

Commit

Permalink
docs: Add docs (#19)
Browse files Browse the repository at this point in the history
* test documentation upload

* Sketch of new documentation

* Wrapping up the skeleton

* more updates to docs

* more updates to docs

* more updates to docs

* more updates to docs

* Updates to docs 7/19
  • Loading branch information
Ritvikj8 authored Jul 30, 2024
1 parent 269a8b9 commit 42b04f0
Show file tree
Hide file tree
Showing 16 changed files with 661 additions and 224 deletions.
27 changes: 27 additions & 0 deletions docs/source/FAQs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# FAQs

## This section will cover FAQs, Common errors, Troubleshooting steps in detail

----

### ST FAQ

----

### Tech FAQ

**Diagnosing Infeasibilities**

Some solvers can help users diagnose infeasibilities in their model. We are aware of that
feature in Gurobi, CPLEX, and XPRESS. If `Resolve` runs into an infeasibility and
the solver is able to identify the infeasibility, sometimes called Irreducible Infeasible Set (IIS),
`Resolve` will save the infeasibility in the run's report folder (e.g., Gurobi will produce a text file
with a `.ilp` file extension).

----

### RV FAQ

----


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
147 changes: 147 additions & 0 deletions docs/source/Initial Model Set-Up/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# Initial Model Set-up


This Section will walk you through on how to install and set up the model.
A lot of this should only be one-time so please make sure that this process is carried out carefully.

## All about environments

Python environments for this project should be thought of as isolated computational spaces
that will have the necessary configurations needed for you to run the specific project or model - which in this case is `Resolve`

Environments help in setting up packages, dependencies, libraries etc by running a simpe command and do not require much computational
background and knowledge - thus enabling the usage of the product for a wide array of stakeholders.

There are many softwares that help in creating, activating and maintaining environments - one of which is `Anaconda`

We recommend using the [Anaconda](https://www.continuum.io/downloads) Python distribution and package manager.
During the installation process, we recommend selecting the "Add Anaconda3 to my `PATH` environment variable" option
so that you have easy access to the `conda` command from the command line.

```{tip}
If you run into any `conda not recognized` or `command not found: conda` messages in the command line in the following steps,
this means that you **did not** add Anaconda to your PATH. You can add either rerun the installer (easiest) or manually
add Anaconda to your PATH (see [these instructions](https://www.geeksforgeeks.org/how-to-setup-anaconda-path-to-environment-variable/) for some help).
```

## Initial `conda` Set-up

In order for `conda` to work properly, you will need to initialize your "shell" (command line, e.g., Command Prompt).

:::::{dropdown} Windows

````{dropdown} Option 1: Using Command Prompt
If you use Command Prompt, open a new Command Prompt window and enter:
```
conda init cmd.exe
```
````

````{dropdown} Option 2: Using PowerShell
If you use PowerShell, open a new PowerShell window and enter:
```
conda init PowerShell
```
Then, close all PowerShell windows, and open a new PowerShell window using the "Run as
Administrator" option (right-click on the PowerShell application icon in the Start Menu to find this option). Then, enter the following command:
```
Set-ExecutionPolicy Unrestricted
```
Then, close the PowerShell window and open a new one.
````

:::::

````{dropdown} macOS Terminal
Since macOS Catalina (10.15), the default "shell" program is `zsh`. These instructions assume you're on a recent version of macOS.
Open Terminal and use the following command:
```
conda init zsh
```
Earlier versions of macOS use `bash`, so replace `zsh` in the command above with `bash`.
````

----

## Creating Environments
Once you have `Anaconda` set-up and have the necessary `Resolve` files and folders you are ready
to create environments.

We will use the `conda` command to create an isolated environment for the Resolve to run within, without
disturbing any other Python packages you may have already installed (see the [`conda` documentation](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) for more details on conda environments).

To create the `conda` environment, we will use the [`environment.yml`](https://github.com/e3-/kit/blob/main/environment.yml)
file at the top level of the repository. Open your shell of choice and navigate into your cloned copy of the repository.
Then, run the following command:

- Create an environment called `resolve-env`:
```bash
conda env create -f environment.yml
```
- In general it is best practice to name your environment for better tractability. That can be as follows:

```bash
conda env create -f environment.yml --name your-environment-name
```

---

### Environments using Pycharm

It is also possible for users to directly use Pycharm as an interface to create and manage Python
based environments for Resolve.

Step 1: Navigate over to your Resolve specific folder on Pycharm - make sure that the file environment.yml is at
the top of the directory

Step 2: At the bottom left of your Pycharm Window, click on the terminal icon to open up the terminal.
This should show your selected directory

step 3: In the terminal enter the following code

- Create an environment called `resolve-test-env`:
```bash
conda env create -f environment.yml --name resolve-test-env
```
Note that the name of the environment is non-consequential and can be set per user's preference.
Once you enter the code, it will take about 2-5 minutes for the system to setup your environment - note that this is a
one-time exercise.
After the installation is done - the terminal will prompt you to either activate or de-activate the environment, which will look
as follows:
![activate_img.png](_images/activate_img.png)
Activating the environment would mean that you now have the virtual computing capabilities to run the model.
If you would like to learn more about virtual environments and dependencies, supplemental information can be found [here](https://www.geeksforgeeks.org/python-virtual-environment/#:~:text=A%20Python%20Virtual%20Environment%20is,a%20virtual%20environment%20in%20Python)
```{tip}
In order to maintain compatability between different versions, and updates of Resolve, it is best practice to use
new environments for each new release. Environments do not interact with one another and this would make sure that the user
is able to switch back and forth between different resolve versions with ease.
```
### Solvers (optional) for the most part
{bdg-info-line}`Optional`
The `resolve-env` environment comes with the open-source [`HiGHS`](https://highs.dev/) solver, which enables
out-of-the-box solving of`Resolve` cases on any platform.
Commercial solvers like Gurobi, IBM CPLEX, and FICO XPRESS offer additional solver features &
typically substantially faster solve times. If you have licenses for any of these solvers, `Resolve` will work with them;
follow the vendor installation & licensing instructions.
[Add point regarding runtime based on solvers]
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Viewing Results
# RESOLVE Results Viewing


Once `Resolve` is done solving, it will save a series of CSVs that summarize the portfolio
investment & operational decisions. These files are stored in the run's report folder, which
Expand All @@ -8,15 +9,20 @@ The `Resolve` package includes a spreadsheet Results Viewer, which is powered by
the data from the CSVs for viewing as formatted figures & tables. See the spreadsheet for more
instructions.

## Raw Results

If users pass the `--raw-results` command line argument when running `Resolve`, a CSV for every
Pyomo Param, Var, Expression, and Constraint will be created and stored in the run's report folder.

## Diagnosing Infeasibilities
## Output File Structures

This section will walk you through what a typical output file structure for RESOLVE looks like

## Raw & Summary Results

Some files offer valuable insights compared to others, this section will look at key outputs and summary results of the run

## RESOLVE Results Viewer

This section will cover where will the end-of-the-day resolve story live



Some solvers can help users diagnose infeasibilities in their model. We are aware of that
feature in Gurobi, CPLEX, and XPRESS. If `Resolve` runs into an infeasibility and
the solver is able to identify the infeasibility, sometimes called Irreducible Infeasible Set (IIS),
`Resolve` will save the infeasibility in the run's report folder (e.g., Gurobi will produce a text file
with a `.ilp` file extension).
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
(running_resolve)=
# Running `Resolve`
# Running Resolve

After saving your input data & case settings (as described in {ref}`saving-inputs`), you are now ready
After saving your input data & case settings (refer below to see how this should
look like) (as described in {ref}`saving-inputs`), you are now ready
to run `Resolve`!

## Insert details on input file structure and directories and where reht are saved


## Running `Resolve` from the Scenario Tool

As in previous versions of `Resolve`, users can run cases directly from the Scenario Tool.
Expand All @@ -27,6 +31,10 @@ Scenario Tool, as discussed below.
- `--raw-results`: Save all raw Pyomo model components as CSVs (for detailed model inspection).
- `--symbolic-solver-labels`: Enable descriptive variable names in the Pyomo model formulation--helpful for debugging.

Tip: If for the installation process, you had used Pycharm or any other Python software, then the recommended
best practice is to run resolve from there after saving the ST as this avoids using macros which might cause computational
issues relating to excel based macros as these are deprecated in newer configurations. [Ritvik to rephrase\]

Examples:
- Run all cases listed in `./data/settings/resolve/cases_to_run.csv`:
```
Expand Down
Loading

0 comments on commit 42b04f0

Please sign in to comment.