Skip to content

Commit

Permalink
Merge pull request #144 from Total-RD/ahalev_bug_fixes
Browse files Browse the repository at this point in the history
Update readme and bump version
  • Loading branch information
ahalev authored Nov 11, 2022
2 parents 2482846 + a1aa9ec commit 4da59f2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 21 deletions.
29 changes: 11 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,29 @@ For more context, please see the [presentation](https://www.climatechange.ai/pap

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install pymgrid. You can clone and cd in the repo and then do:
The easiest way to install pymgrid is with pip:

```bash
pip install .
```
`pip install -U pymgrid`

You can also run this pip command:
Alternatively, you can install from source. First clone the repo:

```bash
pip install git+https://github.com/Total-RD/pymgrid/
```
git clone https://github.com/Total-RD/pymgrid.git
```
Then navigate to the root directory of pymgrid and call


And in Google Colab:
```bash
!pip install git+https://github.com/Total-RD/pymgrid/
pip install .
```

## Getting Started

Microgrids are straightforward to generate from scratch; simply define some modules and pass them
Microgrids are straightforward to generate from scratch. Simply define some modules and pass them
to a microgrid:
```python
import numpy as np
from pymgrid import Microgrid
from pymgrid.microgrid.modules import (
GensetModule,
BatteryModule,
LoadModule,
RenewableModule
)
from pymgrid.microgrid.modules import GensetModule, BatteryModule, LoadModule, RenewableModule


genset = GensetModule(running_min_production=10,
running_max_production=50,
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[metadata]
version = attr: pymgrid.__version__
description-file = README.md

[tool:pytest]
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from pathlib import Path
from setuptools import setup, find_packages

VERSION = (Path(__file__).parent / "version.txt").read_text()
DESCRIPTION = "A simulator for tertiary control of electrical microgrids"
DOWNLOAD_URL = "https://github.com/Total-RD/pymgrid/archive/refs/tags/v1.0-beta.tar.gz"
DOWNLOAD_URL = f"https://github.com/Total-RD/pymgrid/archive/refs/tags/v{VERSION}.tar.gz"
MAINTAINER = "Avishai Halev"
MAINTAINER_EMAIL = "avishaihalev@gmail.com"
LICENSE = "GNU LGPL 3.0"
Expand All @@ -19,6 +20,7 @@
package_dir={"": "src"},
packages=find_packages("src"),
python_requires=">=3.6",
version=VERSION,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
download_url=DOWNLOAD_URL,
Expand Down
2 changes: 1 addition & 1 deletion src/pymgrid/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pathlib import Path

__version__ = '1.0.2'
__version__ = (Path(__file__).parent.parent.parent / "version.txt").read_text()

PROJECT_PATH = Path(__file__).parent

Expand Down
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0.3

0 comments on commit 4da59f2

Please sign in to comment.