Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 39 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,30 @@

# PyGridSim

Package to simulate OpenDSS circuits on Python.

NOTE: README comes from dai cookie cutter, will be updated
NOTE: will be moved to Dai lab repository
PyGridSim is a package that allows user to simulating OpenDSS circuits with Python. PyGridSim uses a functional interface to allow users to efficiently generate circuits of various scopes.
Comment thread
amzhao16 marked this conversation as resolved.
Outdated

- Documentation: https://amzhao.github.io/PyGridSim
- Homepage: https://github.com/amzhao/PyGridSim
Comment thread
amzhao16 marked this conversation as resolved.
Outdated

# Overview

PyGridSim aims to provide accessible access to tools like OpenDSS, AltDSS using Python. The goal is to create large-scale electrical circuits representing residential neighborhoods (and other scenarios) using an intuitive interface, without any background in OpenDSS software.
PyGridSim allows user to create circuits with the amount of customization they desire. Thus, users can either fully specify each component they add to the circuit, or lean on library-provided parameter sets. PyGridSim supports the batch creation of every circuit component, emphasizing scalability and efficiently in building large circuits.
Comment thread
amzhao16 marked this conversation as resolved.
Outdated

# Install
# Installation

## Requirements

**PyGridSim** has been developed and tested on [Python 3.5, 3.6, 3.7 and 3.8](https://www.python.org/downloads/)
**PyGridSim** has been developed and tested on [Python 3.10, 3.11 and 3.12](https://www.python.org/downloads/)

Also, although it is not strictly required, the usage of a [virtualenv](https://virtualenv.pypa.io/en/latest/)
is highly recommended in order to avoid interfering with other software installed in the system
in which **PyGridSim** is run.

These are the minimum commands needed to create a virtualenv using python3.6 for **PyGridSim**:
These are the minimum commands needed to create a virtualenv using python3.10 for **PyGridSim**:

```bash
pip install virtualenv
virtualenv -p $(which python3.6) PyGridSim-venv
virtualenv -p $(which python3.10) PyGridSim-venv
```

Afterwards, you have to execute this command to activate the virtualenv:
Expand Down Expand Up @@ -75,23 +72,44 @@ git checkout stable
make install
```

## Install for Development
# Quick Start
Users of PyGridSim have the option between creating a fully customized circuit and using PyGridSim-provided parameters to build their circuit. Consider the simplest circuit: one source, one load, and a line connecting them. The following code snippet demonstrates how to model and print results on this circuit on PyGridSim with both methods.

## Customized Circuit Creation
```python
circuit = PyGridSim()

# Add Custom Source and Load
circuit.add_load_nodes(params={"kV": 0.12, "kW": 1, "kvar": 1})
circuit.update_source(params={"kV": 0.5})

If you want to contribute to the project, a few more steps are required to make the project ready
for development.
# Add Line
circuit.add_lines([("source", "load0")], params={"length": 1})

Please head to the [Contributing Guide](https://amzhao.github.io/PyGridSim/contributing.html#get-started)
for more details about this process.
# Solve and Print Results
circuit.solve()
print(circuit.results(["Voltages", "Losses"]))
circuit.clear()
```
Comment thread
amzhao16 marked this conversation as resolved.

## Defaults-Based Circuit Creation
```python
circuit = PyGridSim()

# Quickstart
# Add Custom Source and Load
circuit.add_load_nodes(load_type="house")
circuit.update_source(source_type="turbine")

In this short tutorial we will guide you through a series of steps that will help you
getting started with **PyGridSim**.
# Add Line
circuit.add_lines([("source", "load0")], line_type="lv")

TODO: Create a step by step guide here. Also figure out how to ensure prerequisites properly.
# Solve and Print Results
circuit.solve()
print(circuit.results(["Voltages", "Losses"]))
circuit.clear()
```
Comment thread
amzhao16 marked this conversation as resolved.

# What's next?
# Resources

For more details about **PyGridSim** and all its possibilities
and features, please check the [documentation site](
https://amzhao.github.io/PyGridSim/).
and features, please check the [Gitbook page for PyGridSim](https://dtail.gitbook.io/pygridsim)