Commit a090899e authored by Sebastian Schwarz's avatar Sebastian Schwarz
Browse files

Fixed broken pycity_base requirements.

parent b6f6fd0f
Pipeline #472441 failed with stages
in 144 minutes and 41 seconds
......@@ -22,12 +22,13 @@ Its target users are researchers in the field of smart grid applications and the
## Installation
pycity_scheduling requires at least the following Python packages:
- numpy
- pandas
- matplotlib
- pyomo
- Shapely
- pycity_base
- numpy==1.19.5
- pandas==1.1.5
- matplotlib==3.3.4
- pyomo==6.0.0
- Shapely==1.7.1
- pycity_base==0.3.2
- pytest==6.2.4 (optional)
as well as the installation of at least one mathematical programming solver for convex and/or non-convex problems, which is supported by the [Pyomo](http://www.pyomo.org/) optimisation modelling library.
We recommend one of the following solvers:
......@@ -40,7 +41,7 @@ We recommend one of the following solvers:
### Installation of pycity_scheduling
The latest version of pycity_scheduling is v1.0.1.
The latest version of pycity_scheduling is v1.0.2.
If all the abovementioned dependencies are installed, you should be able to install package pycity_scheduling via [PyPI](https://pypi.org/) (using Python 3.X) as follows:
......
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: 'v1.0.1',
VERSION: 'v1.0.2',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
......
......@@ -131,11 +131,11 @@ RUN git clone --depth=1 -b v0.2.1 https://github.com/RWTH-EBC/richardsonpy &&\
# Download, install and test Python package pycity_base:
# Always use a specific tagged pycity_base version from github.
# Thus, pycity_base is downloaded from github and flag -e is used for pip.
RUN git clone --depth=1 -b v0.3.1 https://github.com/RWTH-EBC/pyCity pycity_base &&\
RUN git clone --depth=1 -b v0.3.2 https://github.com/RWTH-EBC/pyCity pycity_base &&\
python3.6 -m pip install --no-cache-dir -e pycity_base/ &&\
python3.6 -m pytest -q pycity_base/
# Download and install the other requirements for package pycity_scheduling:
# Moreover, install the third-party Python site-packages that are required by the used tools during the different CI stages.
RUN python3.6 -m pip install --no-cache-dir numpy pandas matplotlib pyomo Shapely pylint sphinx numpydoc
RUN python3.6 -m pip install --no-cache-dir pylint sphinx numpydoc
......@@ -18,13 +18,13 @@ sys.path.insert(0, os.path.abspath('../../src'))
# -- Project information -----------------------------------------------------
project = 'pycity_scheduling'
copyright = '2020, Institute for Automation of Complex Power Systems (ACS), E.ON Energy Research Center (E.ON ERC), ' \
copyright = '2021, Institute for Automation of Complex Power Systems (ACS), E.ON Energy Research Center (E.ON ERC), ' \
'RWTH Aachen University'
# The short X.Y version
version = 'v1.0.1'
version = 'v1.0.2'
# The full version, including alpha/beta/rc tags
release = 'v1.0.1'
release = 'v1.0.2'
# -- General configuration ---------------------------------------------------
......
......@@ -2,24 +2,39 @@ import matplotlib.pyplot as plt
from pycity_scheduling.classes import *
from pycity_scheduling.algorithms import *
t = Timer(op_horizon=24, step_size=3600, initial_date=(2018, 3, 15), initial_time=(0, 0, 0))
w = Weather(timer=t, location=(50.76, 6.07))
p = Prices(timer=t)
e = Environment(timer=t, weather=w, prices=p)
fi = FixedLoad(environment=e, method=1, annual_demand=3000.0, profile_type="H0")
pv = Photovoltaic(environment=e, method=1, peak_power=6.0)
ba = Battery(environment=e, e_el_max=8.4, p_el_max_charge=3.6, p_el_max_discharge=3.6)
def main(do_plot=False):
t = Timer(op_horizon=24, step_size=3600, initial_date=(2018, 3, 15), initial_time=(0, 0, 0))
w = Weather(timer=t, location=(50.76, 6.07))
p = Prices(timer=t)
e = Environment(timer=t, weather=w, prices=p)
plot_time = list(range(t. timesteps_used_horizon))
fig, axs = plt.subplots(1, 3)
axs[0].plot(plot_time, p. da_prices, color="black")
axs[0].set_title("Day-ahead energy market prices [ct/kWh]")
axs[1].plot(plot_time, fi.p_el_schedule, color="black")
axs[1].set_title("Single-family house electrical load demand [kW]")
axs[2].plot(plot_time, pv.p_el_supply, color="black")
axs[2].set_title("Residential photovoltaics generation [kW]")
for ax in axs.flat:
ax.set(xlabel="Time [h]", xlim=[0, t.timesteps_used_horizon-1])
plt.grid()
plt.show()
fi = FixedLoad(environment=e, method=1, annual_demand=3000.0, profile_type="H0")
pv = Photovoltaic(environment=e, method=1, peak_power=6.0)
ba = Battery(environment=e, e_el_max=8.4, p_el_max_charge=3.6, p_el_max_discharge=3.6)
plot_time = list(range(t. timesteps_used_horizon))
fig, axs = plt.subplots(1, 3)
axs[0].plot(plot_time, p. da_prices, color="black")
axs[0].set_title("Day-ahead energy market prices [ct/kWh]")
axs[1].plot(plot_time, fi.p_el_schedule, color="black")
axs[1].set_title("Single-family house electrical load demand [kW]")
axs[2].plot(plot_time, pv.p_el_supply, color="black")
axs[2].set_title("Residential photovoltaics generation [kW]")
for ax in axs.flat:
ax.set(xlabel="Time [h]", xlim=[0, t.timesteps_used_horizon-1])
plt.grid()
if do_plot:
figManager = plt.get_current_fig_manager()
if hasattr(figManager, "window"):
figManagerWindow = figManager.window
if hasattr(figManagerWindow, "state"):
figManager.window.state("zoomed")
plt.show()
return
if __name__ == '__main__':
# Run example:
main(do_plot=True)
......@@ -2,38 +2,53 @@ import matplotlib.pyplot as plt
from pycity_scheduling.classes import *
from pycity_scheduling.algorithms import *
t = Timer(op_horizon=24, step_size=3600, initial_date=(2018, 3, 15), initial_time=(0, 0, 0))
w = Weather(timer=t, location=(50.76, 6.07))
p = Prices(timer=t)
e = Environment(timer=t, weather=w, prices=p)
fi = FixedLoad(environment=e, method=1, annual_demand=3000.0, profile_type="H0")
pv = Photovoltaic(environment=e, method=1, peak_power=6.0)
ba = Battery(environment=e, e_el_max=8.4, p_el_max_charge=3.6, p_el_max_discharge=3.6)
plot_time = list(range(t. timesteps_used_horizon))
fig, axs = plt.subplots(1, 3)
axs[0].plot(plot_time, p. da_prices, color="black")
axs[0].set_title("Day-ahead energy market prices [ct/kWh]")
axs[1].plot(plot_time, fi.p_el_schedule, color="black")
axs[1].set_title("Single-family house electrical load demand [kW]")
axs[2].plot(plot_time, pv.p_el_supply, color="black")
axs[2].set_title("Residential photovoltaics generation [kW]")
for ax in axs.flat:
ax.set(xlabel="Time [h]", xlim=[0, t.timesteps_used_horizon-1])
plt.grid()
plt.show()
bd = Building(environment=e, objective="none")
bes = BuildingEnergySystem(environment=e)
ap = Apartment(environment=e)
bd. addMultipleEntities(entities=[bes, ap])
bes . addDevice(objectInstance=pv)
ap. addMultipleEntities(entities=[fi, ba])
cd = CityDistrict(environment=e, objective="price")
cd. addEntity(bd, position=(0, 0))
opt = CentralOptimization(city_district=cd, mode="integer")
res = opt.solve()
cd.copy_schedule(dst="optim_schedule")
def main(do_plot=False):
t = Timer(op_horizon=24, step_size=3600, initial_date=(2018, 3, 15), initial_time=(0, 0, 0))
w = Weather(timer=t, location=(50.76, 6.07))
p = Prices(timer=t)
e = Environment(timer=t, weather=w, prices=p)
fi = FixedLoad(environment=e, method=1, annual_demand=3000.0, profile_type="H0")
pv = Photovoltaic(environment=e, method=1, peak_power=6.0)
ba = Battery(environment=e, e_el_max=8.4, p_el_max_charge=3.6, p_el_max_discharge=3.6)
plot_time = list(range(t. timesteps_used_horizon))
fig, axs = plt.subplots(1, 3)
axs[0].plot(plot_time, p. da_prices, color="black")
axs[0].set_title("Day-ahead energy market prices [ct/kWh]")
axs[1].plot(plot_time, fi.p_el_schedule, color="black")
axs[1].set_title("Single-family house electrical load demand [kW]")
axs[2].plot(plot_time, pv.p_el_supply, color="black")
axs[2].set_title("Residential photovoltaics generation [kW]")
for ax in axs.flat:
ax.set(xlabel="Time [h]", xlim=[0, t.timesteps_used_horizon-1])
plt.grid()
if do_plot:
figManager = plt.get_current_fig_manager()
if hasattr(figManager, "window"):
figManagerWindow = figManager.window
if hasattr(figManagerWindow, "state"):
figManager.window.state("zoomed")
plt.show()
return
bd = Building(environment=e, objective="none")
bes = BuildingEnergySystem(environment=e)
ap = Apartment(environment=e)
bd. addMultipleEntities(entities=[bes, ap])
bes . addDevice(objectInstance=pv)
ap. addMultipleEntities(entities=[fi, ba])
cd = CityDistrict(environment=e, objective="price")
cd. addEntity(bd, position=(0, 0))
opt = CentralOptimization(city_district=cd, mode="integer")
res = opt.solve()
cd.copy_schedule(dst="optim_schedule")
if __name__ == '__main__':
# Run example:
main(do_plot=True)
......@@ -2,51 +2,66 @@ import matplotlib.pyplot as plt
from pycity_scheduling.classes import *
from pycity_scheduling.algorithms import *
t = Timer(op_horizon=24, step_size=3600, initial_date=(2018, 3, 15), initial_time=(0, 0, 0))
w = Weather(timer=t, location=(50.76, 6.07))
p = Prices(timer=t)
e = Environment(timer=t, weather=w, prices=p)
fi = FixedLoad(environment=e, method=1, annual_demand=3000.0, profile_type="H0")
pv = Photovoltaic(environment=e, method=1, peak_power=6.0)
ba = Battery(environment=e, e_el_max=8.4, p_el_max_charge=3.6, p_el_max_discharge=3.6)
plot_time = list(range(t. timesteps_used_horizon))
fig, axs = plt.subplots(1, 3)
axs[0].plot(plot_time, p. da_prices, color="black")
axs[0].set_title("Day-ahead energy market prices [ct/kWh]")
axs[1].plot(plot_time, fi.p_el_schedule, color="black")
axs[1].set_title("Single-family house electrical load demand [kW]")
axs[2].plot(plot_time, pv.p_el_supply, color="black")
axs[2].set_title("Residential photovoltaics generation [kW]")
for ax in axs.flat:
ax.set(xlabel="Time [h]", xlim=[0, t.timesteps_used_horizon-1])
plt.grid()
plt.show()
bd = Building(environment=e, objective="none")
bes = BuildingEnergySystem(environment=e)
ap = Apartment(environment=e)
bd. addMultipleEntities(entities=[bes, ap])
bes . addDevice(objectInstance=pv)
ap. addMultipleEntities(entities=[fi, ba])
cd = CityDistrict(environment=e, objective="price")
cd. addEntity(bd, position=(0, 0))
opt = CentralOptimization(city_district=cd, mode="integer")
res = opt.solve()
cd.copy_schedule(dst="optim_schedule")
from pycity_scheduling.util.metric import self_consumption
from pycity_scheduling.util.plot_schedules import plot_entity
from pycity_scheduling.util.write_schedules import schedule_to_json
cd.load_schedule(schedule="optim_schedule")
plot_entity(entity=cd, schedule=["optim_schedule"], title="City district - Cost-optimal schedules")
plot_entity(entity=ba, schedule=["optim_schedule"], title="Battery unit - Cost-optimal schedules")
print(self_consumption(entity=bd))
schedule_to_json(input_list=[fi, pv, ba], file_name="cost_optim.json", schedule=["optim_schedule"])
def main(do_plot=False):
t = Timer(op_horizon=24, step_size=3600, initial_date=(2018, 3, 15), initial_time=(0, 0, 0))
w = Weather(timer=t, location=(50.76, 6.07))
p = Prices(timer=t)
e = Environment(timer=t, weather=w, prices=p)
fi = FixedLoad(environment=e, method=1, annual_demand=3000.0, profile_type="H0")
pv = Photovoltaic(environment=e, method=1, peak_power=6.0)
ba = Battery(environment=e, e_el_max=8.4, p_el_max_charge=3.6, p_el_max_discharge=3.6)
plot_time = list(range(t. timesteps_used_horizon))
fig, axs = plt.subplots(1, 3)
axs[0].plot(plot_time, p. da_prices, color="black")
axs[0].set_title("Day-ahead energy market prices [ct/kWh]")
axs[1].plot(plot_time, fi.p_el_schedule, color="black")
axs[1].set_title("Single-family house electrical load demand [kW]")
axs[2].plot(plot_time, pv.p_el_supply, color="black")
axs[2].set_title("Residential photovoltaics generation [kW]")
for ax in axs.flat:
ax.set(xlabel="Time [h]", xlim=[0, t.timesteps_used_horizon-1])
plt.grid()
if do_plot:
figManager = plt.get_current_fig_manager()
if hasattr(figManager, "window"):
figManagerWindow = figManager.window
if hasattr(figManagerWindow, "state"):
figManager.window.state("zoomed")
plt.show()
return
bd = Building(environment=e, objective="none")
bes = BuildingEnergySystem(environment=e)
ap = Apartment(environment=e)
bd. addMultipleEntities(entities=[bes, ap])
bes . addDevice(objectInstance=pv)
ap. addMultipleEntities(entities=[fi, ba])
cd = CityDistrict(environment=e, objective="price")
cd. addEntity(bd, position=(0, 0))
opt = CentralOptimization(city_district=cd, mode="integer")
res = opt.solve()
cd.copy_schedule(dst="optim_schedule")
from pycity_scheduling.util.metric import self_consumption
from pycity_scheduling.util.plot_schedules import plot_entity
from pycity_scheduling.util.write_schedules import schedule_to_json
cd.load_schedule(schedule="optim_schedule")
plot_entity(entity=cd, schedule=["optim_schedule"], title="City district - Cost-optimal schedules")
plot_entity(entity=ba, schedule=["optim_schedule"], title="Battery unit - Cost-optimal schedules")
print(self_consumption(entity=bd))
schedule_to_json(input_list=[fi, pv, ba], file_name="cost_optim.json", schedule=["optim_schedule"])
if __name__ == '__main__':
# Run example:
main(do_plot=True)
......@@ -34,7 +34,7 @@ setuptools.setup(
name="pycity_scheduling",
description="A Python framework for the development, testing, and assessment of optimization-based"
"power scheduling algorithms for multi-energy systems in city districts",
version="1.0.1",
version="1.0.2",
author="Institute for Automation of Complex Power Systems (ACS),"
"E.ON Energy Research Center (E.ON ERC),"
"RWTH Aachen University",
......@@ -45,15 +45,15 @@ setuptools.setup(
package_data={"pycity_scheduling": ["data/*.txt"], "examples": ["*.ipynb"]},
data_files=[(".", ["LICENSE.txt", "README.md"])],
install_requires=[
"numpy",
"pandas",
"matplotlib",
"pyomo",
"Shapely",
"pycity_base>=0.3.1"
"numpy==1.19.5",
"pandas==1.1.5",
"matplotlib==3.3.4",
"pyomo==6.0.0",
"Shapely==1.7.1",
"pycity_base==0.3.2"
],
extras_require={
"test": ["pytest"]
"test": ["pytest==6.2.4"]
},
platforms="any",
long_description=long_description,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment