Skip to content

Commit

Permalink
Merge pull request #758 from Som-Energia/fix_houly_bal-can
Browse files Browse the repository at this point in the history
Indicar ESIOS Token en el cálcul per Balears i Canàries
  • Loading branch information
pauboixsom authored Jan 7, 2025
2 parents 370c85a + 3e50184 commit 6967f73
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions som_indexada/giscedata_hourly_energy_price.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ def get_monthly_price_baleares(self, cursor, uid, tarifa, data_inici, day=None,
perdues = Tarifa.perdclass('A1_%(perdfname)s_%(postfix)s' % locals(), esios_token) # [%]

# Desvios
scdsvdem = Scdsvdem('C2_Scdsvdem_%(postfix)s' % locals()) # noqa: F405 [€/MWh]
factor_dsv = self.get_coeficient_component(data_inici_dt, 'factor_dsv') # [%]
scdsvdem = Scdsvdem('C2_Scdsvdem_%(postfix)s' % locals(), esios_token) # noqa: F405 [€/MWh]
factor_dsv = Tarifa.get_coeficient_component(data_inici_dt, 'factor_dsv') # [%]
dsv = scdsvdem * (factor_dsv * 0.01)

# NON-VARIABLE COMPONENTS PRICE OBTENTION
Expand All @@ -158,7 +158,7 @@ def get_monthly_price_baleares(self, cursor, uid, tarifa, data_inici, day=None,
pa = Tarifa.get_peaje_component(data_inici_dt, holidays) # [€/kWh]
k = Tarifa.get_coeficient_component(data_inici_dt, 'k') # [€/kWh]
d = Tarifa.get_coeficient_component(data_inici_dt, 'd') # [€/kWh]
gdos = self.get_coeficient_component(data_inici_dt, 'gdos') # [€/MWh]
gdos = Tarifa.get_coeficient_component(data_inici_dt, 'gdos') # [€/MWh]

A = ((sphdem + pc3_ree + dsv + ree + gdos) * 0.001)
B = (1 + (perdues * 0.01))
Expand Down Expand Up @@ -306,14 +306,15 @@ def get_monthly_price_canaries(self, cursor, uid, tarifa, data_inici, day=None,

# Desvios
scdsvdem = Scdsvdem('C2_Scdsvdem_%(postfix)s' % locals()) # noqa: F405 [€/MWh]
factor_dsv = self.get_coeficient_component(data_inici_dt, 'factor_dsv') # [%]
factor_dsv = Tarifa.get_coeficient_component(data_inici_dt, 'factor_dsv') # [%]
dsv = scdsvdem * (factor_dsv * 0.01)

filename = 'Sprpcap{}_{}'.format(Tarifa.code.replace('.', ''), 'CANARIAS')
classname = globals()[filename]
pc3_ree = classname('A1_%(filename)s_%(postfix)s' % locals(), esios_token) # [€/MWh]
si = SIFree('A1_sifree_%(postfix)s' % locals(), esios_token) # noqa: F405 [€/MWh]
ree = Tarifa.get_coeficient_component(data_inici_dt, 'om') # [€/MWh]
Tarifa.get_perdclass()
perdfname = Tarifa.perdclass.name
perdues = Tarifa.perdclass('A1_%(perdfname)s_%(postfix)s' % locals(), esios_token) # [%]

Expand All @@ -323,7 +324,7 @@ def get_monthly_price_canaries(self, cursor, uid, tarifa, data_inici, day=None,
pa = Tarifa.get_peaje_component(data_inici_dt, holidays) # [€/kWh]
k = Tarifa.get_coeficient_component(data_inici_dt, 'k') # [€/kWh]
d = Tarifa.get_coeficient_component(data_inici_dt, 'd') # [€/kWh]
gdos = self.get_coeficient_component(data_inici_dt, 'gdos') # [€/MWh]
gdos = Tarifa.get_coeficient_component(data_inici_dt, 'gdos') # [€/MWh]

A = ((sphdem + pc3_ree + ree + gdos + dsv) * 0.001)
B = (1 + (perdues * 0.01))
Expand Down

0 comments on commit 6967f73

Please sign in to comment.