oemof / demandlib

Creating heat and power demand profiles from annual values.
https://oemof.org
MIT License
54 stars 38 forks source link

Features/revise methods for elec slp #45

Closed uvchik closed 2 years ago

uvchik commented 2 years ago

This PR should help to make the behaviour of the methods more explicit.

The following code should explain the new API. Method names are to be discussed :smile:

.from demandlib import bdew

# read standard load profiles
e_slp = bdew.ElecSlp(year=2020)
print(e_slp.get_profiles("h0", "g0"))
print(e_slp.get_profiles())
elec_demand = e_slp.scale_profiles({"h0": 5000, "g0": 3000})
print(elec_demand)
print(elec_demand.sum())
print(elec_demand.sum(axis=1))
print(elec_demand.sum(axis=1).sum())

elec_power = e_slp.get_scaled_power_profiles({"h0": 5000, "g0": 3000})
print(elec_power)
print(elec_power.sum().div(4))
print(elec_power.sum(axis=1))
print(elec_power.sum(axis=1).div(4).sum())

elec_power = e_slp.get_scaled_power_profiles(
    {"h0": 5000, "g0": 3000}, conversion_factor=0.5
)
print(elec_power)
print(elec_power.sum().div(0.5))
pep8speaks commented 2 years ago

Hello @uvchik! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:

Comment last updated at 2021-12-15 09:57:53 UTC
uvchik commented 2 years ago

https://demandlib.readthedocs.io/en/features-revise-methods-for-elec-slp/bdew.html#electrical-profiles