-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from thisistheplace/feature/multithreading
Performance: added option to move matplotlib figure generation to separate process
- Loading branch information
Showing
18 changed files
with
394 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ on: | |
branches: | ||
- 'master' | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-22.04 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,54 +12,61 @@ This tool was developed as part of a PhD, "Modelling and Design of Local Energy | |
1. Install [Python 3.10](https://www.python.org/downloads/) and [Git](https://git-scm.com/). | ||
|
||
2. Clone this git repo onto your machine: | ||
``` | ||
git clone [email protected]:andrewlyden/PyLESA.git | ||
``` | ||
``` | ||
git clone [email protected]:andrewlyden/PyLESA.git | ||
``` | ||
3. Install the `PyLESA` python virtual environment. | ||
If using Linux: | ||
``` | ||
python3.10 -m venv venv | ||
source venv/bin/activate | ||
python -m pip install --upgrade pip | ||
python -m pip install -r requirements.txt | ||
``` | ||
|
||
If using Windows and Powershell: | ||
``` | ||
python -m venv venv | ||
.\venv\Scripts\activate.ps1 | ||
python -m pip install --upgrade pip | ||
python -m pip install -r requirements.txt | ||
``` | ||
If using Linux: | ||
``` | ||
python3.10 -m venv venv | ||
source venv/bin/activate | ||
python -m pip install --upgrade pip | ||
python -m pip install -r requirements.txt | ||
``` | ||
If using Windows and Powershell: | ||
``` | ||
python -m venv venv | ||
.\venv\Scripts\activate.ps1 | ||
python -m pip install --upgrade pip | ||
python -m pip install -r requirements.txt | ||
``` | ||
4. Define and gather data on the local energy system to be modelled including resources, demands, supply, storage, grid connection, and control strategy. Define the increments and ranges to be modelled within the required parametric design. Input all this data using one of the template Excel Workbooks from the [inputs](./inputs) folder. | ||
5. Optionally run the demand ([heat_demand.py](./pylesa/demand/heat_demand.py) and [electricity_demand.py](./pylesa/demand/electricity_demand.py)) and resource assessment methods (see PhD thesis for details) to generate hourly profiles depending on available data. Input generated profiles into the Excel Workbook. | ||
6. Using a terminal (e.g. PowerShell) within the clone of the `PyLESA` git repo, run: | ||
If using Linux: | ||
If using Linux: | ||
```python | ||
source venv/bin/activate | ||
python -m pylesa --help # to display help messages | ||
python -m pylesa ./inputs/{name of Excel input file}.xlsx my/existing/output/directory --overwrite | ||
``` | ||
```python | ||
source venv/bin/activate | ||
python -m pylesa --help # to display help messages | ||
python -m pylesa ./inputs/{name of Excel input file}.xlsx my/existing/output/directory --overwrite | ||
``` | ||
If using Windows and Powershell: | ||
If using Windows and Powershell: | ||
```python | ||
.\venv\Scripts\activate.ps1 | ||
python -m pylesa --help # to display help messages | ||
python -m pylesa ./inputs/{name of Excel input file}.xlsx my/existing/output/directory --overwrite | ||
``` | ||
```python | ||
.\venv\Scripts\activate.ps1 | ||
python -m pylesa --help # to display help messages | ||
python -m pylesa ./inputs/{name of Excel input file}.xlsx my/existing/output/directory --overwrite | ||
``` | ||
Running `python -m pylesa --help` will display the following help message: | ||
![pylesa usage](./img/pylesa_usage.png) | ||
Note that PyLESA defaults to using 2 compute cores: 1 to run the solver, 1 to generate matplotlib | ||
figures and write them to disc. Using the `--singlecore` command-line option will force PyLESA | ||
to run on a single core which will increase the overall runtime. | ||
Running `python -m pylesa --help` will display the following help message: | ||
![pylesa usage](./img/pylesa_usage.png) | ||
7. After the run is complete, open the outpus folder in your chosen run directory to view the KPI 3D plots and/or operational graphs, as well as .csv outputs (note that an error will be raised if only one simulation combination is run, as 3D plots cannot be processed). There are also raw outputs.pkl files for each simulation combination which contains a vast range of raw outputs. | ||
7. After the run is complete, open the outpus folder in your chosen run directory to view the KPI 3D plots and/or operational graphs, as well as .csv outputs. (Note an error will be raised if only one simulation combination is run, as 3D plots cannot be processed). There are also raw outputs.pkl files for each simulation combination which contains a vast range of raw outputs. | ||
Information about the run is written to a `pylesa.log` file located in the output folder. This | ||
file contains details of run progress and any warning or error messages that may have occurred. | ||
A video discussing how to run `PyLESA` is available here: https://youtu.be/QsJut9ftCT4 | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +0,0 @@ | ||
from .constants import DEFAULT_LOGLEVEL | ||
from .logging import setup_logging | ||
|
||
setup_logging(DEFAULT_LOGLEVEL) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.