Skip to content

Commit

Permalink
read me with the installation proedure
Browse files Browse the repository at this point in the history
Signed-off-by: Edoardo De Din <ededin@eonerc.rwth-aachen.de>
  • Loading branch information
edoardo-dedin committed Jun 27, 2022
1 parent e07a399 commit 68ff696
Show file tree
Hide file tree
Showing 55 changed files with 66 additions and 49 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ csv_files/plots/
powerflow/powerflow
venv_ext
covee_env
dist
build
*.csv
*.eps
*.png
Expand Down
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ RUN apt-get update -y \
&& apt install python3-pip -y \
&& apt-get install python3-venv -y \
&& apt-get install sudo -y

COPY ../conf.json tmp/
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
SHELL := /bin/bash

init:
python3 ./setup/createEnv.py -y
python3 ./create_env/createEnv.py -y
source covee_env/bin/activate -y && \
pip install --upgrade pip && \
pip install -r ./setup/requirements.txt
pip install --upgrade pip
pip install .
clean:
sudo rm -R -f covee_env
rm -R -f __pycache__
rm -R -f covee_env.egg-info
rm -R -f covee_env.egg-info
rm -R -f covee.egg-info
rm -R -f dist
rm -R -f build
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,33 @@
# CoVee

CoVee is a Python package implementing several voltage control methods.
CoVee is a Python package that can be used to implement and test several voltage control methods.

## Installation

### User

Install the covee package with

$ python setup.py install

### Virtual Environment (only for Linux)

Create a virtual environment and install the covee package with

$ make init

### Docker version with docker-compose

$ sudo docker-compose up
$ sudo docker exec -it (CONTAINER) bash
$ cd covee
$ make init
$ covee_env/bin/python3 covee_main.py


## License

The project is released under the terms of the [MPL 2.0](https://mozilla.org/MPL/2.0/).
The project is released under the terms of the [MPL 2.0](https://mozilla.org/MPL/2.0/).

## Getting Started

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from scipy import sparse
import coloredlogs, logging, threading

import control_strategies.quadratic_control_cvxpy as quadratic_control
import covee.control_strategies.quadratic_control_cvxpy as quadratic_control

class Quadratic_Control():

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import control_strategies.quadratic_control_dualascent as quadratic_control
import covee.control_strategies.quadratic_control_dualascent as quadratic_control
import numpy as np

class Quadratic_Control():
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self, conf_dict):

def select_control(self):

self.control_module = 'control_strategies.'+self.conf_dict["CONTROL_MODULE"]
self.control_module = 'covee.control_strategies.'+self.conf_dict["CONTROL_MODULE"]
try:
module = import_module(self.control_module)
except:
Expand All @@ -24,7 +24,7 @@ def select_control(self):

def select_case(self):

self.case_module = 'cases.'+self.conf_dict["CASE_MODULE"]
self.case_module = 'covee.cases.'+self.conf_dict["CASE_MODULE"]
try:
module = import_module(self.case_module)
except:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ def read_csv(self):
# =============================================================

cwd = os.getcwd()
wd = os.path.join(cwd, 'powerflow/powerflow_class/data/profiles/Test')
wd = os.path.join(cwd, 'covee/powerflow/data/profiles/Test')
wd.replace("\\", "/")
wd1 = os.path.join(cwd, 'powerflow/powerflow_class/csv_files/profiles')
wd1 = os.path.join(cwd, 'covee/powerflow/csv_files/profiles')
wd1.replace("\\", "/")
k = 1
for key in profiles:
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os

cwd = os.getcwd()
wd = os.path.join(cwd, 'covee/powerflow/powerflow_class/data/profiles')
wd = os.path.join(cwd, 'covee/powerflow/data/profiles')

csv_file = '/Test/PV_profile.csv'
profile = wd + csv_file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
from pypower.idx_gen import GEN_BUS, PG, QG, PMAX, PMIN, QMAX, QMIN, VG, GEN_STATUS
from pypower.int2ext import int2ext

from powerflow.powerflow_class.csv_files.read_profiles import read_profiles
from covee.powerflow.csv_files.read_profiles import read_profiles

from scipy.sparse import issparse, vstack, hstack, csr_matrix as sparse
from numpy import flatnonzero as find

import numpy as np
from pypower.ppoption import ppoption

from powerflow.powerflow_class.csv_files.read_profiles import read_profiles
from covee.powerflow.csv_files.read_profiles import read_profiles



Expand Down
13 changes: 7 additions & 6 deletions covee_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
import coloredlogs, logging, threading
import time
import json
from pypower.api import *
from pypower.ext2int import ext2int
import control_strategies.utils as utils
from importlib import import_module
from powerflow.powerflow_class.runPF_class import runPF_class
from csv_files.save_results import save_results
from alive_progress import alive_bar
from pypower.api import *
from pypower.ext2int import ext2int
import covee.control_strategies.utils as utils
from covee.powerflow.runPF_class import runPF_class
from covee.csv_files.save_results import save_results


'''
coloredlogs.install(level='DEBUG',
Expand All @@ -25,7 +26,7 @@

# Read json file and set Control Strategy and Case
# =====================================================================================================
with open("./conf.json", "r") as f:
with open("./examples/conf.json", "r") as f:
conf_dict = json.load(f)

module_obj = utils.select(conf_dict)
Expand Down
File renamed without changes.
18 changes: 4 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,9 @@ services:
build:
context: '.'
dockerfile: './Dockerfile'
networks:
- edgeflex-network
volumes:
- .:/centralized
command: bash -c "cd centralized &&
make init &&
cd .. &&
/covee/covee/bin/python3 /covee/Control_main.py --ext_port 7071"
# command: tail -F dfsdfödslk
- ./:/covee
stdin_open: true
# command: tail -F dgrthetyj
ports:
- 7071:8000

networks:
edgeflex-network:
external:
name: edgeflex-network
- 7071:8000
6 changes: 6 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# CoVee - Getting Started





Empty file added examples/__init__.py
Empty file.
4 changes: 2 additions & 2 deletions conf.json → examples/conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@

"STATE_ESTIMATION": "no", "__comment__": "with yes, the control algorithm considers the full set of voltage nodes, as if the state estimation would be integrated / Not implemented yet" ,

"SAVE_PATH" : "csv_files/results",
"PLOT_PATH": "csv_files/plots"
"SAVE_PATH" : "covee/csv_files/results",
"PLOT_PATH": "covee/csv_files/plots"
}
2 changes: 1 addition & 1 deletion setup/setup.py → setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],

setup(
name="covee control",
name="covee",
version="0.1",
author="Edoardo De Din",
author_email="acs-software@eonerc.rwth-aachen.de",
Expand Down
1 change: 0 additions & 1 deletion setup/requirements.txt

This file was deleted.

8 changes: 0 additions & 8 deletions setup/requirements_docker.txt

This file was deleted.

0 comments on commit 68ff696

Please sign in to comment.