Releases: jnettels/annuity
Remove deprecated dependency
Full Changelog: 0.5.0...0.5.1
Rename package to 'annuity' and automate publication on conda
The package can now be installed with conda install annuity -c jnettels
Include cost database example
An example Excel file that demonstrates the use of a cost database as an input is now included. The included data are only examples, a user must still validate their own cost assumptions. New input arguments allow more customization, e.g. in the column names of the cost database.
Further generalize the input for annual demands and proceeds
Changelog
Rename VDI2067.system()
Due to fixing some pylint warnings, the class VDI2067.system() is now called VDI2067.System().
Change input for sys.calc_annuities()
The approach for calling the primary method sys.calc_annuities() has changed, to make its use more flexible.
Prior, a call would have looked like this. Specific DataFrames had to be prepared for the three cost types "demand", "proceeds" and "other", and their respective price change factors r_V, r_E, r_S were arguments of calc_annuities(). This meant that one could not simply use a larger amout of different price change factors for different cost types.
df_V1 = pd.DataFrame(
{'quantity': [5410.9, 3954.4, 92],
'price': [20, 30, 237.4]},
index=['Demand 1', 'Demand 2', 'Demand 3'])
df_E1 = pd.DataFrame(
{'quantity': [494, 1811, 8098, 3954, 1852],
'price': [100, 146, 60, 30, 220]},
index=['Proceed 1', 'Proceed 2', 'Proceed 3', 'Proceed 4', 'Proceed 5'])
# Calculate the annuity of the energy system
q = 1.03 # interest factor
T = 20 # observation period
sys.calc_annuities(T=T, q=q,
df_V1=df_V1,
r_V=1.03,
df_E1=df_E1,
r_E=1.03,
) # Get Series of annuities
Now, you need to prepare one DataFrame with all the cost types combined, including the price change factor for each. You can construct the DataFrame anyway you like, but:
- demand costs must have a negative price (while proceeds are defined positive)
- a column named "r" with the price change factors must be included
df_V1 = pd.DataFrame(
{'quantity': [5410.9, 3954.4, 92],
'price': [-20, -30, -237.4]},
index=['Demand 1', 'Demand 2', 'Demand 3'])
df_E1 = pd.DataFrame(
{'quantity': [494, 1811, 8098, 3954, 1852],
'price': [100, 146, 60, 30, 220]},
index=['Proceed 1', 'Proceed 2', 'Proceed 3', 'Proceed 4', 'Proceed 5'])
df_V1['r'] = 1.03 # set same price change factor for all entries
df_E1['r'] = 1.05 # set same price change factor for all entries
df_VSE = pd.concat([df_V1, df_E1],
keys=['Demand-related costs', 'Proceeds'])
# Calculate the annuity of the energy system
q = 1.03 # interest factor (which is an interest rate of 3 %)
T = 20 # observation period
sys.calc_annuities(T=T, q=q, df_VSE=df_VSE) # Series of annuities
One advantage is that the table of costs and yields can now be freely structured, including the use of a MultiIndex (created by using concat()). The index is preserved, and the manipulated DataFrame can be accessed like so:
print(sys.df_VSE)
With this result: (quantity, price and r are preserved, the other columns are filled in)
quantity price a b product T q r
Demand-related costs Demand 1 5410.9 -20.0 0.067216 19.417476 -141241.736791 20.0 1.03 1.03
Demand 2 3954.4 -30.0 0.067216 19.417476 -154833.666478 20.0 1.03 1.03
Demand 3 92.0 -237.4 0.067216 19.417476 -28505.724786 20.0 1.03 1.03
Proceeds Proceed 1 494.0 100.0 0.067216 23.453330 77875.750594 20.0 1.03 1.05
Proceed 2 1811.0 146.0 0.067216 23.453330 416818.131813 20.0 1.03 1.05
Proceed 3 8098.0 60.0 0.067216 23.453330 765956.876491 20.0 1.03 1.05
Proceed 4 3954.0 30.0 0.067216 23.453330 186996.387358 20.0 1.03 1.05
Proceed 5 1852.0 220.0 0.067216 23.453330 642301.534859 20.0 1.03 1.05
"Product" (the annuity) is the product of quantity, price, a (annuity factor) and b (cash value factor). T, q and r are stored to preserve all input data.