Skip to content

Commit b37c963

Browse files
committed
Prepare for uploading v2.2 to PyPI
1 parent b8aa8cd commit b37c963

File tree

5 files changed

+51
-17
lines changed

5 files changed

+51
-17
lines changed

README.md

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,63 @@ PowNet is a least-cost optimization model for simulating the Unit Commitment and
99
Read the PowNet Documentation here: https://pownet.readthedocs.io/en/latest
1010

1111

12-
## Installation
12+
## Installing and using PowNet
13+
To use PowNet, a user needs to supply it with CSV files. For guidance on creating these CSV files, please see examples provided [here](https://github.com/Critical-Infrastructure-Systems-Lab/PowNet/tree/master/model_library). Please ensure that column names matches with those from the examples.
1314

14-
Download or clone the PowNet 2.0 repository to your local machine. For example: if we want to clone to "C://user/pownet",
15+
As for installing PowNet, there are multiple options depending on whether we want to modify the source code. However, the following step is highly recommended for any user: creating a virtual environment to manage dependencies. If using Conda, we can create an envrionment with the following command
1516

1617
```
17-
git clone https://github.com/your-username/pownet.git C://user/pownet
18+
conda create --name your_env_name_here
19+
conda activate your_env_name_here
1820
```
1921

20-
Next, open a terminal and navigate to the directory where you cloned the repository:
22+
If deciding on a name for the environment takes too long, please feel free to name the environment as "pownet".
23+
24+
### Option 1: Regular user
25+
A regular user is someone who has created their input files and wish to just run PowNet. In this case, it is best to simply install PowNet as a package from PyPI. We can achieve this with the following command:
2126

2227
```
23-
cd C://user/pownet
28+
pip install pownet
29+
```
30+
31+
Once the package has been installed, we can now go to our working directory. In this example, we assume the following folder structure:
32+
33+
working_directory/
34+
├── scripts/
35+
│ └── [run_quickstart.py](https://github.com/Critical-Infrastructure-Systems-Lab/PowNet/blob/master/scripts/run_quickstart.py)
36+
├── model_library/
37+
│ └── dummy/
38+
│ ├── demand_export.csv
39+
│ ├── thermal_unit.csv
40+
│ ├── nondispatch_unit.csv
41+
│ ├── hydropower.csv
42+
│ ├── import.csv
43+
│ ├── contract_cost.csv
44+
│ └── transmission.csv
45+
└── outputs/
46+
47+
A Python script called "[run_quickstart.py](https://github.com/Critical-Infrastructure-Systems-Lab/PowNet/blob/master/scripts/run_quickstart.py)" provides an example on running a simulation, saving the simulation outputs, and visualizing the outputs.
48+
49+
### Option 2: Power user (no pun intended)
50+
In case we wish to modify the source code, PowNet should be installed as an editable package. First, download or clone the PowNet repository to your local machine. For example: if we want to clone to "C://user/pownet",
51+
52+
```
53+
git clone https://github.com/your-username/pownet.git C://user/pownet
2454
```
2555

26-
The following step is highly recommended: creating a virtual environment to manage dependencies. If using Conda, you can create an envrionment named "pownet":
56+
Next, open a terminal and navigate to the directory where we cloned the repository:
2757

2858
```
29-
conda create --name pownet
30-
conda activate pownet
59+
cd C://user/pownet
3160
```
3261

33-
Now, you can install this PowNet package using pip, which is a manager for Python packages:
62+
Now, we can install this PowNet package using pip, which is a manager for Python packages:
3463

3564
```
3665
pip install -e .
3766
```
3867

39-
This command installs the package in "editable" mode (-e) using pyproject.toml that is located in the root directory of PowNet. The editable mode allows you to edit PowNet codebase when you need to modify or implement new features. The pyproject.toml file specifies the dependencies required to run PowNet.
68+
This command installs the package in "editable" mode (-e) using pyproject.toml that is located in the root directory of PowNet. The editable mode allows us to edit PowNet codebase when we need to modify or implement new features. The pyproject.toml file specifies the dependencies required to run PowNet.
4069

4170
A quick start tutorial to run a simple case study is provided here: https://pownet.readthedocs.io/en/latest/pages/quickstarter.html
4271

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Content
1717
pages/support
1818
pages/release
1919
pages/glossary
20-
pages/license
20+
pages/license_page
2121
pages/acknowledgement
2222
pages/publications
2323
api_pages/api
File renamed without changes.

pyproject.toml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,19 @@ where = ["src"]
99
pownet = ["database/*.csv"]
1010

1111
[project]
12-
name = "cisl-pownet"
13-
version = "2.0.0"
12+
name = "pownet"
13+
version = "2.2.0"
1414
description = "A simple production cost model of framework for power systems"
1515
readme = "README.md"
1616
authors = [{ name = "Phumthep Bunnak", email = "[email protected]" }]
17-
keywords = ["power_system", "optimization", "production_cost_model"]
17+
license = { file = "LICENSE" }
18+
keywords = ["power_system", "optimization", "production_cost_model", "unit_commitment"]
1819
dependencies = [
1920
"gurobipy >= 11.0.3",
2021
"highspy >= 1.7.2",
2122
"matplotlib >= 3.7.1",
2223
"networkx >= 3.1.0",
23-
"numpy == 1.26.4",
24+
"numpy == 2.2.0",
2425
"pandas >= 2.1.1",
2526
"pmdarima >= 2.0.4",
2627
"scipy >= 1.11.3",
@@ -30,3 +31,7 @@ dependencies = [
3031
"contextily >= 1.6.2",
3132
]
3233
requires-python = ">=3.10"
34+
35+
[project.urls]
36+
Homepage = "https://github.com/Critical-Infrastructure-Systems-Lab/PowNet"
37+
Documentation = "https://pownet.readthedocs.io/en/latest/index.html"

scripts/run_quickstart.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ def main():
1010
# --------- User inputs
1111

1212
input_folder = "..//model_library"
13-
output_folder = "..//temptemp"
13+
output_folder = "..//outputs"
1414

1515
model_name = "dummy"
1616
model_year = 2016
1717

1818
# Simulation parameters
1919
sim_horizon = 24
20-
steps_to_run = 2
20+
steps_to_run = 2 # 2 Simulation days or 48 hours
2121
solver = "gurobi" # or highs
2222

2323
# --------- End of user inputs

0 commit comments

Comments
 (0)