-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTariff.py
More file actions
50 lines (37 loc) · 1.97 KB
/
Tariff.py
File metadata and controls
50 lines (37 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# -*- coding: utf-8 -*-
import pandas as pd
import pandas.api.types as ptypes
class _CostTariff:
"""_CostTariff tariff object class with attributes used to define a given tariff.
NOTE - Cost = +VE, Revenue = -VE
Created by Adam T. Deaney 2024 02 22"""
def __init__(self, name, value_profile):
# Validation
assert isinstance(name, str), "Name must be str type"
assert isinstance(value_profile, pd.core.series.Series), "Value profile must be series type"
assert value_profile.index._is_all_dates, "Value profile index must be datetime"
assert ptypes.is_numeric_dtype(value_profile), "Value profile values must be float"
# Attribute Assignment
self.name = name # Throughput cost/revenue name
self.value_profile = value_profile.rename('Value_£/kWh') # £/kWh, Where Cost = +VE, Revenue = -VE
class MicrogridImpTariff(_CostTariff):
"""MicrogridImpTariff tariff object class with attributes used to define costs/revenues applied to import flows
from components to microgrid.
NOTE - Cost = +VE, Revenue = -VE
Created by Adam T. Deaney 2024 02 22"""
def __init__(self, name, value_profile):
_CostTariff.__init__(self, name, value_profile)
class MicrogridExpTariff(_CostTariff):
"""MicrogridExpTariff tariff object class with attributes used to define costs/revenues applied to export flows
from microgrid to components.
NOTE - Cost = +VE, Revenue = -VE
Created by Adam T. Deaney 2024 02 22"""
def __init__(self, name, value_profile):
_CostTariff.__init__(self, name, value_profile)
class ThroughputTariff(_CostTariff):
"""ThroughputTariff tariff object class with attributes used to define costs/revenues attributed to both imports
and exports through a microgrid component.
NOTE - Cost = +VE, Revenue = -VE
Created by Adam T. Deaney 2024 02 22"""
def __init__(self, name, value_profile):
_CostTariff.__init__(self, name, value_profile)