Metadata-Version: 2.1
Name: nygrid
Version: 0.1.0
Summary: A python version of the NYgrid model
Home-page: https://github.com/boyuan276/NYgrid-python
Author: The NYgrid-python Developers
Author-email: The NYgrid-python Developers <by276@cornell.edu>
Maintainer: Bo Yuan
Maintainer-email: Bo Yuan <by276@cornell.edu>
License: MIT License
Project-URL: homepage, https://github.com/boyuan276/NYgrid-python
Keywords: Power system,Renewable energy,Optimization
Platform: Any
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: pandas
Requires-Dist: pyomo
Requires-Dist: pypower
Requires-Dist: matplotlib
Requires-Dist: openpyxl
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: black; extra == "dev"

# NYgrid-python

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/boyuan276/NYgrid-python/blob/main/LICENSE)
![Python](https://img.shields.io/badge/python-3.8-blue.svg)
![Python](https://img.shields.io/badge/python-3.9-blue.svg)
[![Python package](https://github.com/boyuan276/solar-farm-design/actions/workflows/python-package.yml/badge.svg)](https://github.com/boyuan276/NYgrid-python/actions/workflows/python-package.yml)
[![CodeQL](https://github.com/boyuan276/NYgrid-python/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/boyuan276/NYgrid-python/actions/workflows/github-code-scanning/codeql)

A python version of the NYgrid model.

It contains the following components:
* Optimal power flow (OPF) model
* Renewable integration
* Building electrification
* Battery storage
* Electric vehicle (EV) charging

## Installation

1. Install [Anaconda](https://www.anaconda.com/download/).
2. Install [Git](https://git-scm.com/downloads).
3. Clone the repository: 
```bash
git clone https://github.com/boyuan276/NYgrid-python.git
```
4. Create a conda environment:
```bash
conda env create -f NYgrid-python.yml
```
5. Activate the environment:
```bash
conda activate NYgrid-python
```
6. Install the package:
```bash
pip install -e .
```

## Usage

1. Activate the environment:

```bash
conda activate NYgrid-python
```

2. Run the model:

    - Go to the `examples` folder.

    - Run the model with default parameters:

        ```bash
        python ex_opf_wo_renew.py
        ```

    - Run the model with renewable integration:

        ```bash
        # With future distributed solar integration
        python ex_opf_w_future_solar.py

        # With offshore wind integration
        python ex_opf_w_offshore_wind.py

        # With solar, offshore wind, and building electrification integration
        python ex_opf_w_renew.py
        ```

Note: Renewable timeseries data need to be prepared before running the model.


## See also
* [MATLAB version of the NYgrid model](https://github.com/AndersonEnergyLab-Cornell/NYgrid.git)
