Skip to content

Commit

Permalink
update tutorial to run
Browse files Browse the repository at this point in the history
  • Loading branch information
yasirroni committed Sep 26, 2023
1 parent c3ccbd0 commit 99d2327
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Parse MATPOWER case into pandas DataFrame.

Unlike the [tutorial](https://github.com/yasirroni/matpower-pip#extra-require-oct2py-or-matlabengine) on [`matpower-pip`](https://github.com/yasirroni/matpower-pip), this package support parsing MATPOWER case using `re` instead of `Oct2Py` and Octave. After that, you can further parse the data into any format supported by your solver.
Unlike the [tutorial](https://github.com/yasirroni/matpower-pip#extra-require-oct2py-or-matlabengine) on [`matpower-pip`](https://github.com/yasirroni/matpower-pip), this package supports parsing MATPOWER case using `re` instead of `Oct2Py` and Octave. After that, you can further parse the data into any format supported by your solver.

## Installation

Expand All @@ -12,6 +12,8 @@ pip install matpowercaseframes

## Usage

The main utility of `matpowercaseframes` is to help read `matpower` data in user-friendly format as follows,

```python
from matpowercaseframes import CaseFrames

Expand All @@ -21,7 +23,7 @@ cf = CaseFrames(case_path)
print(cf.gencost)
```

If you have `matpower` installed via `pip install matpower` (did not require `matpower[octave]`), you can easily navigate MATPOWER case using:
If you have `matpower` installed via `pip install matpower` (did not require `matpower[octave]`), you can easily navigate `matpower` case using:

```python
import os
Expand All @@ -35,6 +37,19 @@ cf = CaseFrames(case_path)
print(cf.gencost)
```

Furthermore, `matpowercaseframes` also support generating data that is acceptable by `matpower` via `matpower-pip` package (require `matlab` or `octave`),

```python
from matpowercaseframes import CaseFrames

case_path = 'case9.m'
cf = CaseFrames(case_path)
mpc = cf.to_dict()

m = start_instance()
m.runpf(mpc)
```

To save all `DataFrame` to a single `xlsx` file, use:

```python
Expand Down

0 comments on commit 99d2327

Please sign in to comment.