-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindicators_spec.py
More file actions
2348 lines (2201 loc) · 102 KB
/
indicators_spec.py
File metadata and controls
2348 lines (2201 loc) · 102 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: utf-8 -*-
from expects.testing import failure
from expects import *
from mamba import *
from datetime import datetime, date
import dateutil.parser
import json
from pytz import timezone
import os
from esios import Esios
from esios.indicators import *
with description('Indicators file'):
with before.all:
ESIOS_TOKEN = os.getenv('ESIOS_TOKEN')
self.token = ESIOS_TOKEN
self.tz = timezone('Europe/Madrid')
self.start_date = self.tz.localize(datetime(2017, 1, 1, 0, 0))
self.end_date = self.tz.localize(datetime(2017, 1, 31, 23, 59))
with context('ProfilePVPC'):
with it('Returns ProfilePVPC instance'):
e = Esios(self.token)
profile = ProfilePVPC(e)
assert isinstance(profile, ProfilePVPC)
with it('Returns a valid ProfilePVPC20A'):
e = Esios(self.token)
profile = ProfilePVPC20A(e)
assert isinstance(profile, ProfilePVPC20A)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Tarifa 2.0.A (peaje por defecto)')
)
expect(data['indicator']['name']).to(
contain(u'Perfiles de consumo')
)
expect(len(data['indicator']['values'])).to(equal(744))
with it('Returns a valid ProfilePVPC20DHA'):
e = Esios(self.token)
profile = ProfilePVPC20DHA(e)
assert isinstance(profile, ProfilePVPC20DHA)
data = profile.get(self.start_date, self.end_date)
profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Tarifa 2.0.DHA (Eficiencia 2 periodos)')
)
expect(data['indicator']['name']).to(
contain(u'Perfiles de consumo')
)
expect(len(data['indicator']['values'])).to(equal(744))
with it('Returns a valid ProfilePVPC20DHS'):
e = Esios(self.token)
profile = ProfilePVPC20DHS(e)
assert isinstance(profile, ProfilePVPC20DHS)
data = profile.get(self.start_date, self.end_date)
profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Tarifa 2.0.DHS (vehículo eléctrico)')
)
expect(data['indicator']['name']).to(
contain(u'Perfiles de consumo')
)
expect(len(data['indicator']['values'])).to(equal(744))
with context('PricePVPC'):
with it('Returns PricePVPC instance'):
e = Esios(self.token)
prices = PricePVPC(e)
assert isinstance(prices, PricePVPC)
with it('Returns a valid PricePVPC20A'):
e = Esios(self.token)
prices = PricePVPC20A(e)
assert isinstance(prices, PricePVPC20A)
data = prices.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'PVPC T. Defecto')
)
expect(data['indicator']['name']).to(
contain(u'Término de facturación')
)
expect(len(data['indicator']['values'])).to(equal(744))
with it('Returns a valid PricePVPC20DHA'):
e = Esios(self.token)
prices = PricePVPC20DHA(e)
assert isinstance(prices, PricePVPC20DHA)
data = prices.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'PVPC T. Eficiencia 2 periodos')
)
expect(data['indicator']['name']).to(
contain(u'Término de facturación')
)
expect(len(data['indicator']['values'])).to(equal(744))
with it('Returns a valid PricePVPC20DHS'):
e = Esios(self.token)
prices = PricePVPC20DHS(e)
assert isinstance(prices, PricePVPC20DHS)
data = prices.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'PVPC V. Eléctrico')
)
expect(data['indicator']['name']).to(
contain(u'Término de facturación')
)
expect(len(data['indicator']['values'])).to(equal(744))
with it('Returns a valid PricePVPC20A Summer-Winter'):
e = Esios(self.token)
prices = PricePVPC20A(e)
assert isinstance(prices, PricePVPC20A)
data = prices.get(
self.tz.localize(datetime(2016, 10, 1, 0, 0)),
self.tz.localize(datetime(2016, 10, 31, 23, 59)),
)
expect(data['indicator']['short_name']).to(
equal(u'PVPC T. Defecto')
)
expect(data['indicator']['name']).to(
contain(u'Término de facturación')
)
expect(dateutil.parser.parse(
data['indicator']['values'][0]['datetime']
).hour).to(equal(0))
# Summer hour 2 (24 * 29 + 3 = 699)
# Summer 2:00
summer_hour = data['indicator']['values'][698]['datetime']
expect(dateutil.parser.parse(summer_hour).hour).to(equal(2))
expect(dateutil.parser.parse(summer_hour).utcoffset().seconds).to(
equal(7200)
)
# Winter 2:00
winter_hour = data['indicator']['values'][699]['datetime']
expect(dateutil.parser.parse(winter_hour).hour).to(equal(2))
expect(dateutil.parser.parse(winter_hour).utcoffset().seconds).to(
equal(3600)
)
expect(len(data['indicator']['values'])).to(equal(745))
with it('Returns PriceEnergiaExcedentariaAutoconsumCompensacioSimplificada instance'):
e = Esios(self.token)
prices = PriceEnergiaExcedentariaAutoconsumCompensacioSimplificada(e)
assert isinstance(prices, PriceEnergiaExcedentariaAutoconsumCompensacioSimplificada)
with it('Returns a valid PricePVPC20A Winter-Summer'):
e = Esios(self.token)
prices = PricePVPC20A(e)
assert isinstance(prices, PricePVPC20A)
data = prices.get(
self.tz.localize(datetime(2016, 3, 1, 0, 0)),
self.tz.localize(datetime(2016, 3, 31, 23, 59)),
)
expect(data['indicator']['short_name']).to(
equal(u'PVPC T. Defecto')
)
expect(data['indicator']['name']).to(
contain(u'Término de facturación')
)
expect(dateutil.parser.parse(
data['indicator']['values'][0]['datetime']
).hour).to(equal(0))
# Winter hour 2 (24 * 26 + 1 = 625)
# Winter 1:00
winter_hour = data['indicator']['values'][625]['datetime']
expect(dateutil.parser.parse(winter_hour).hour).to(equal(1))
expect(dateutil.parser.parse(winter_hour).utcoffset().seconds).to(
equal(3600)
)
# Summer 3:00
summer_hour = data['indicator']['values'][626]['datetime']
expect(dateutil.parser.parse(summer_hour).hour).to(equal(3))
expect(dateutil.parser.parse(summer_hour).utcoffset().seconds).to(
equal(7200)
)
expect(len(data['indicator']['values'])).to(equal(743))
with it('Returns a valid PricePVPC20TD'):
e = Esios(self.token)
prices = PricePVPC20TD(e)
assert isinstance(prices, PricePVPC20TD)
data = prices.get(
self.tz.localize(datetime(2021, 6, 1, 0, 0)),
self.tz.localize(datetime(2021, 6, 30, 23, 59)),
)
expect(data['indicator']['short_name']).to(
equal(u'PVPC T. 2.0TD')
)
expect(data['indicator']['name']).to(
contain(u'Término de facturación')
)
expect(dateutil.parser.parse(
data['indicator']['values'][0]['datetime']
).hour).to(equal(0))
# Commented till a month is complete
expect(len(data['indicator']['values']) / 5).to(equal(720)) # there are 5 different subsystems for each hour
with it('Returns a valid ProfilePVPC20TD'):
e = Esios(self.token)
profiles = ProfilePVPC20TD(e)
assert isinstance(profiles, ProfilePVPC20TD)
data = profiles.get(
self.tz.localize(datetime(2021, 6, 1, 0, 0)),
self.tz.localize(datetime(2021, 6, 30, 23, 59)),
)
expect(data['indicator']['short_name']).to(
equal(u'Tarifa 2.0TD')
)
expect(data['indicator']['name']).to(
contain(u'Perfiles de consumo a efectos de facturación del PVPC Tarifa 2.0TD')
)
expect(dateutil.parser.parse(
data['indicator']['values'][0]['datetime']
).hour).to(equal(0))
# Commented till a month is complete
expect(len(data['indicator']['values'])).to(equal(720))
with context('LinkBalanceMorocco'):
with it('Returns LinkBalanceMorocco instance'):
e = Esios(self.token)
profile = LinkBalanceMorocco(e)
assert isinstance(profile, LinkBalanceMorocco)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Saldo neto Marruecos telemedidas')
)
expect(data['indicator']['name']).to(
contain(u'Saldo horario neto de interconexión con Marruecos telemedidas')
)
with context('DemandaDiariaElectricaPeninsularPrevista'):
with it('Returns DemandaDiariaElectricaPeninsularPrevista instance'):
# 460
e = Esios(self.token)
# Hourly case
profile = DemandaDiariaElectricaPeninsularPrevista(e)
assert isinstance(profile, DemandaDiariaElectricaPeninsularPrevista)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Previsión diaria')
)
expect(data['indicator']['name']).to(
contain(u'Previsión diaria de la demanda eléctrica peninsular')
)
with context('DemandaDiariaElectricaPeninsularPrevistaQh'):
with it('Returns DemandaDiariaElectricaPeninsularPrevistaQh instance'):
# 460
e = Esios(self.token)
# Hourly case
profile = DemandaDiariaElectricaPeninsularPrevistaQh(e)
assert isinstance(profile, DemandaDiariaElectricaPeninsularPrevistaQh)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Previsión diaria')
)
expect(data['indicator']['name']).to(
contain(u'Previsión diaria de la demanda eléctrica peninsular')
)
with context('PMDSNP'):
with it('Returns pmd_snp instance'):
# 573
e = Esios(self.token)
profile = pmd_snp(e)
assert isinstance(profile, pmd_snp)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Precio medio demanda sistema')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio de la demanda en los SNP por sistema')
)
with context('mqhpDailyMarket'):
with it('Returns mqhpDailyMarket instance'):
# 600
e = Esios(self.token)
profile = mqhpDailyMarket(e)
assert isinstance(profile, mqhpDailyMarket)
start_date = self.tz.localize(datetime(2025, 10, 1, 0, 0))
end_date = self.tz.localize(datetime(2025, 10, 1, 23, 45))
data = profile.get(start_date, end_date)
expect(data['indicator']['short_name']).to(
equal(u'Mercado SPOT')
)
expect(data['indicator']['name']).to(
equal(u'Precio mercado SPOT Diario')
)
values = [x for x in data['indicator']['values'] if 'Esp' in x['geo_name']]
values = sorted(values, key=lambda d: d['datetime_utc'])
expect(len(values)).to(
equal(96)
)
expect(values[0]['value']).to(
equal(105.1)
)
expect(values[-1]['value']).to(
equal(101.52)
)
with context('PriceSpotIntradaily1'):
with it('Returns PriceSpotIntradaily1 instance'):
# 612
e = Esios(self.token)
profile = PriceSpotIntradaily1(e)
assert isinstance(profile, PriceSpotIntradaily1)
start_date = self.tz.localize(datetime(2021, 11, 1, 1, 0))
end_date = self.tz.localize(datetime(2021, 12, 1, 0, 0))
data = profile.get(start_date, end_date)
expect(data['indicator']['short_name']).to(
equal(u'Intradiario Sesión 1')
)
expect(data['indicator']['name']).to(
equal(u'Precio mercado SPOT Intradiario Sesión 1')
)
# QH tests (since October 2025)
start_date = self.tz.localize(datetime(2025, 10, 1, 0, 0))
end_date = self.tz.localize(datetime(2025, 10, 1, 23, 59))
data = profile.get(start_date, end_date)
values = [x for x in data['indicator']['values'] if 'Esp' in x['geo_name']]
values = sorted(values, key=lambda d: d['datetime_utc'])
expect(len(values)).to(
equal(96)
)
expect(values[0]['value']).to(
equal(106.1)
)
expect(values[-1]['value']).to(
equal(105.01)
)
with context('PriceSpotIntradaily2'):
with it('Returns PriceSpotIntradaily2 instance'):
# 613
e = Esios(self.token)
profile = PriceSpotIntradaily2(e)
assert isinstance(profile, PriceSpotIntradaily2)
start_date = self.tz.localize(datetime(2021, 11, 1, 1, 0))
end_date = self.tz.localize(datetime(2021, 12, 1, 0, 0))
data = profile.get(start_date, end_date)
expect(data['indicator']['short_name']).to(
equal(u'Intradiario Sesión 2')
)
expect(data['indicator']['name']).to(
equal(u'Precio mercado SPOT Intradiario Sesión 2')
)
# QH tests (since October 2025)
start_date = self.tz.localize(datetime(2025, 10, 1, 0, 0))
end_date = self.tz.localize(datetime(2025, 10, 1, 23, 59))
data = profile.get(start_date, end_date)
values = [x for x in data['indicator']['values'] if 'Esp' in x['geo_name']]
values = sorted(values, key=lambda d: d['datetime_utc'])
expect(len(values)).to(
equal(96)
)
expect(values[0]['value']).to(
equal(102.75)
)
expect(values[-1]['value']).to(
equal(115.15)
)
with context('PriceSpotIntradaily3'):
with it('Returns PriceSpotIntradaily3 instance'):
# 614
e = Esios(self.token)
profile = PriceSpotIntradaily3(e)
assert isinstance(profile, PriceSpotIntradaily3)
start_date = self.tz.localize(datetime(2021, 11, 1, 1, 0))
end_date = self.tz.localize(datetime(2021, 12, 1, 0, 0))
data = profile.get(start_date, end_date)
expect(data['indicator']['short_name']).to(
equal(u'Intradiario Sesión 3')
)
expect(data['indicator']['name']).to(
equal(u'Precio mercado SPOT Intradiario Sesión 3')
)
# QH tests (since October 2025)
start_date = self.tz.localize(datetime(2025, 10, 1, 0, 0))
end_date = self.tz.localize(datetime(2025, 10, 1, 23, 59))
data = profile.get(start_date, end_date)
values = [x for x in data['indicator']['values'] if 'Esp' in x['geo_name']]
values = sorted(values, key=lambda d: d['datetime_utc'])
expect(len(values)).to(
equal(48)
)
expect(values[0]['value']).to(
equal(-9.34)
)
expect(values[-1]['value']).to(
equal(106.52)
)
with context('PriceSpotIntradaily4'):
with it('Returns PriceSpotIntradaily4 instance'):
# 615
e = Esios(self.token)
profile = PriceSpotIntradaily4(e)
assert isinstance(profile, PriceSpotIntradaily4)
start_date = self.tz.localize(datetime(2021, 11, 1, 1, 0))
end_date = self.tz.localize(datetime(2021, 12, 1, 0, 0))
data = profile.get(start_date, end_date)
expect(data['indicator']['short_name']).to(
equal(u'Intradiario Sesión 4')
)
expect(data['indicator']['name']).to(
equal(u'Precio mercado SPOT Intradiario Sesión 4')
)
with context('PriceSpotIntradaily5'):
with it('Returns PriceSpotIntradaily5 instance'):
# 616
e = Esios(self.token)
profile = PriceSpotIntradaily5(e)
assert isinstance(profile, PriceSpotIntradaily5)
start_date = self.tz.localize(datetime(2021, 11, 1, 1, 0))
end_date = self.tz.localize(datetime(2021, 12, 1, 0, 0))
data = profile.get(start_date, end_date)
expect(data['indicator']['short_name']).to(
equal(u'Intradiario Sesión 5')
)
expect(data['indicator']['name']).to(
equal(u'Precio mercado SPOT Intradiario Sesión 5')
)
with context('PriceSpotIntradaily6'):
with it('Returns PriceSpotIntradaily6 instance'):
# 617
e = Esios(self.token)
profile = PriceSpotIntradaily6(e)
assert isinstance(profile, PriceSpotIntradaily6)
start_date = self.tz.localize(datetime(2021, 11, 1, 1, 0))
end_date = self.tz.localize(datetime(2021, 12, 1, 0, 0))
data = profile.get(start_date, end_date)
expect(data['indicator']['short_name']).to(
equal(u'Intradiario Sesión 6')
)
expect(data['indicator']['name']).to(
equal(u'Precio mercado SPOT Intradiario Sesión 6')
)
with context('PriceSpotIntradaily7'):
with it('Returns PriceSpotIntradaily7 instance'):
# 618
e = Esios(self.token)
profile = PriceSpotIntradaily7(e)
assert isinstance(profile, PriceSpotIntradaily7)
start_date = self.tz.localize(datetime(2021, 11, 1, 1, 0))
end_date = self.tz.localize(datetime(2021, 12, 1, 0, 0))
data = profile.get(start_date, end_date)
expect(data['indicator']['short_name']).to(
equal(u'Intradiario Sesión 7')
)
expect(data['indicator']['name']).to(
equal(u'Precio mercado SPOT Intradiario Sesión 7')
)
with context('PriceChargeBiasToUp'):
with it('Returns PriceChargeBiasToUp instance'):
# 686
e = Esios(self.token)
profile = PriceChargeBiasToUp(e)
assert isinstance(profile, PriceChargeBiasToUp)
start_date = self.tz.localize(datetime(2022, 1, 1, 1, 0))
end_date = self.tz.localize(datetime(2022, 1, 31, 0, 0))
data = profile.get(start_date, end_date)
expect(data['indicator']['short_name']).to(
equal(u'Desv\xedos a subir')
)
expect(data['indicator']['name']).to(
equal(u'Precio de cobro desv\xedos a subir')
)
with context('PriceChargeBiasToDown'):
with it('Returns PriceChargeBiasToDown instance'):
# 687
e = Esios(self.token)
profile = PriceChargeBiasToDown(e)
assert isinstance(profile, PriceChargeBiasToDown)
start_date = self.tz.localize(datetime(2022, 1, 1, 1, 0))
end_date = self.tz.localize(datetime(2022, 1, 31, 0, 0))
data = profile.get(start_date, end_date)
expect(data['indicator']['short_name']).to(
equal(u'Precio de pago desv\xedos a bajar')
)
expect(data['indicator']['name']).to(
equal(u'Precio de pago desv\xedos a bajar')
)
with context('ChargeBiasHigherProduction'):
with it('Returns ChargeBiasHigherProduction instance'):
# 726
e = Esios(self.token)
profile = ChargeBiasHigherProduction(e)
assert isinstance(profile, ChargeBiasHigherProduction)
start_date = self.tz.localize(datetime(2022, 1, 1, 1, 0))
end_date = self.tz.localize(datetime(2022, 1, 31, 0, 0))
data = profile.get(start_date, end_date)
expect(data['indicator']['short_name']).to(
equal(u'Mayor producci\xf3n')
)
expect(data['indicator']['name']).to(
equal(u'Coste de los desv\xedos medidos de mayor producci\xf3n')
)
with context('ChargeBiasLowerProduction'):
with it('Returns ChargeBiasLowerProduction instance'):
# 727
e = Esios(self.token)
profile = ChargeBiasLowerProduction(e)
assert isinstance(profile, ChargeBiasLowerProduction)
start_date = self.tz.localize(datetime(2022, 1, 1, 1, 0))
end_date = self.tz.localize(datetime(2022, 1, 31, 0, 0))
data = profile.get(start_date, end_date)
expect(data['indicator']['short_name']).to(
equal(u'Menor producci\xf3n')
)
expect(data['indicator']['name']).to(
equal(u'Coste de los desv\xedos medidos de menor producci\xf3n')
)
with context('PMM Free'):
with it('Returns pmh_pmm_free instance'):
# 792
e = Esios(self.token)
profile = pmh_pmm_free(e)
assert isinstance(profile, pmh_pmm_free)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Precio medio cuarto horario componente mercado diario contratación libre')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio cuarto horario componente mercado diario contratación libre')
)
with context('RT3 Free'):
with it('Returns pmh_pbf_free_RT3 instance'):
# 793
e = Esios(self.token)
profile = pmh_pbf_free_RT3(e)
assert isinstance(profile, pmh_pbf_free_RT3)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Precio medio cuarto horario componente restricciones PBF contratación libre')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio cuarto horario componente restricciones PBF contratación libre')
)
with context('RT6 Free'):
with it('Returns pmh_tiempo_real_free_RT6 instance'):
# 794
e = Esios(self.token)
profile = pmh_tiempo_real_free_RT6(e)
assert isinstance(profile, pmh_tiempo_real_free_RT6)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Precio medio cuarto horario componente restricciones tiempo real contratación libre')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio cuarto horario componente restricciones tiempo real contratación libre')
)
with context('RT4 Free'):
with it('Returns pmh_intradiario_free_RT4 instance'):
# 796
e = Esios(self.token)
profile = pmh_intradiario_free_RT4(e)
assert isinstance(profile, pmh_intradiario_free_RT4)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Com. Libre')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio horario componente restricciones intradiario contrataci\xf3n libre')
)
with context('PS3 Free'):
with it('Returns pmh_res_pot_sub_free_PS3 instance'):
# 797
e = Esios(self.token)
profile = pmh_res_pot_sub_free_PS3(e)
assert isinstance(profile, pmh_res_pot_sub_free_PS3)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Com. Libre')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio horario componente reserva de potencia adicional a subir contrataci\xf3n libre')
)
with context('BS3 Free'):
with it('Returns pmh_bs_free_BS3 instance'):
# 798
e = Esios(self.token)
profile = pmh_bs_free_BS3(e)
assert isinstance(profile, pmh_bs_free_BS3)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Precio medio cuarto horario componente banda secundaria contratación libre')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio cuarto horario componente banda secundaria contratación libre')
)
with context('Medium Hourly Price Components'):
with it('Returns mhpMeasuredDeviationsFree'):
#799
# equivalent to grcosdnc Coste Desvios (9th field)
e = Esios(self.token)
profile = mhpMeasuredDeviationsFree(e)
assert isinstance(profile, mhpMeasuredDeviationsFree)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Precio medio cuarto horario componente desvíos contratación libre')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio cuarto horario componente desvíos contratación libre')
)
with it('Returns pmh_saldo_desv_free_EXD'):
#800
e = Esios(self.token)
profile = pmh_saldo_desv_free_EXD(e)
assert isinstance(profile, pmh_saldo_desv_free_EXD)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Precio medio cuarto horario componente saldo desvíos contratación libre')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio cuarto horario componente saldo desvíos contratación libre')
)
with it('Returns mhpPO146SaldoFree'):
#802
e = Esios(self.token)
profile = mhpPO146BalanceFree(e)
assert isinstance(profile, mhpPO146BalanceFree)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Saldo P.O.14.6 contratación libre')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio cuarto horario componente saldo P.O.14.6. contratación libre')
)
with it('Returns mhpFalloNominacionUPGFree'):
#803
e = Esios(self.token)
profile = mhpFalloNominacionUPGFree(e)
assert isinstance(profile, mhpFalloNominacionUPGFree)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Com. Libre')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio horario componente fallo nominación UPG contratación libre')
)
with it('Returns mhpDailyMarket instance'):
#805
e = Esios(self.token)
profile = mhpDailyMarket(e)
assert isinstance(profile, mhpDailyMarket)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Precio medio cuarto horario componente mercado diario')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio cuarto horario componente mercado diario')
)
with it('Returns mhpPBF instance'):
#806
e = Esios(self.token)
profile = mhpPBF(e)
assert isinstance(profile, mhpPBF)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Restricciones PBF')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio cuarto horario componente restricciones PBF')
)
with it('Returns mhpRealTimeRestrictions instance'):
#807
e = Esios(self.token)
profile = mhpRealTimeRestrictions(e)
assert isinstance(profile, mhpRealTimeRestrictions)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Restricciones TR')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio cuarto horario componente restricciones tiempo real')
)
with it('Returns mhpIntraDailyMarket instance'):
#808
e = Esios(self.token)
profile = mhpIntraDailyMarket(e)
assert isinstance(profile, mhpIntraDailyMarket)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Precio medio cuarto horario componente mercado intradiario')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio cuarto horario componente mercado intradiario')
)
with it('Returns mhpIntradailyMarketRestrictions instance'):
#809
e = Esios(self.token)
profile = mhpIntradailyMarketRestrictions(e)
assert isinstance(profile, mhpIntradailyMarketRestrictions)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Restricciones Intradiario')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio horario componente restricciones intradiario ')
)
with it('Returns mhpAdditionalPowerReservation instance'):
#810
e = Esios(self.token)
profile = mhpAdditionalPowerReservation(e)
assert isinstance(profile, mhpAdditionalPowerReservation)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Reserva Potencia Adicional Subir')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio horario componente reserva de potencia adicional a subir ')
)
with it('Returns mhpSecondaryBand instance'):
#811
e = Esios(self.token)
profile = mhpSecondaryBand(e)
assert isinstance(profile, mhpSecondaryBand)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Precio medio cuarto horario componente banda secundaria')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio cuarto horario componente banda secundaria')
)
with it('Returns mhpMeasuredDsv instance'):
#812
e = Esios(self.token)
profile = mhpMeasuredDsv(e)
assert isinstance(profile, mhpMeasuredDsv)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Precio medio cuarto horario componente desvíos')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio cuarto horario componente desvíos')
)
with it('Returns mhpDesviationsBalance instance'):
#813
e = Esios(self.token)
profile = mhpDesviationsBalance(e)
assert isinstance(profile, mhpDesviationsBalance)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Precio medio cuarto horario componente saldo desvíos')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio cuarto horario componente saldo desvíos')
)
with it('Returns mhpCapPayments instance'):
#814
e = Esios(self.token)
profile = mhpCapPayments(e)
assert isinstance(profile, mhpCapPayments)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Precio medio cuarto horario componente pagos capacidad')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio cuarto horario componente pagos capacidad')
)
with it('Returns mhpPO146Balance'):
#815
e = Esios(self.token)
profile = mhpPO146Balance(e)
assert isinstance(profile, mhpPO146Balance)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Precio medio cuarto horario componente saldo P.O.14.6.')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio cuarto horario componente saldo P.O.14.6.')
)
with it('Returns mhpUpgNomination'):
#816
e = Esios(self.token)
profile = mhpUpgNomination(e)
assert isinstance(profile, mhpUpgNomination)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Fallo nominaci\xf3n UPG')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio horario componente fallo nominaci\xf3n UPG ')
)
with it('Returns PriceMedioAnualMercadoDiario'):
#961
e = Esios(self.token)
profile = PriceMedioAnualMercadoDiario(e)
assert isinstance(profile, PriceMedioAnualMercadoDiario)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'mercado diario')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio anual componente mercado diario')
)
with it('Returns mhpInterruptibilityServiceFree instance'):
#1276
e = Esios(self.token)
profile = mhpInterruptibilityServiceFree(e)
assert isinstance(profile, mhpInterruptibilityServiceFree)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Com. Libre')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio horario componente servicio de interrumpibilidad contratación libre')
)
with it('Returns mhpInterruptibilityService instance'):
#1277
e = Esios(self.token)
profile = mhpInterruptibilityService(e)
assert isinstance(profile, mhpInterruptibilityService)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Servicio de interrumpibilidad')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio horario componente servicio de interrumpibilidad ')
)
with it('Returns mhpPowerFactorControlFree instance'):
#1285
e = Esios(self.token)
profile = mhpPowerFactorControlFree(e)
assert isinstance(profile, mhpPowerFactorControlFree)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Precio medio cuarto horario componente control factor potencia contratación libre')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio cuarto horario componente control factor potencia contratación libre')
)
with it('Returns mhpPowerFactorControl instance'):
#1286
e = Esios(self.token)
profile = mhpPowerFactorControl(e)
assert isinstance(profile, mhpPowerFactorControl)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Precio medio cuarto horario componente control factor potencia')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio cuarto horario componente control factor potencia')
)
with it('Returns DemandaDiariaElectricaPeninsularReal instance'):
# 1293
e = Esios(self.token)
# Hourly case
profile = DemandaDiariaElectricaPeninsularReal(e)
assert isinstance(profile, DemandaDiariaElectricaPeninsularReal)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Demanda real')
)
expect(data['indicator']['name']).to(
contain(u'Demanda real')
)
with it('Returns DemandaDiariaElectricaPeninsularRealQh instance'):
# 1293
e = Esios(self.token)
# Hourly case
profile = DemandaDiariaElectricaPeninsularRealQh(e)
assert isinstance(profile, DemandaDiariaElectricaPeninsularRealQh)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Demanda real')
)
expect(data['indicator']['name']).to(
contain(u'Demanda real')
)
with it('Returns mhpEnergyBalanceFree instance'):
#1366
e = Esios(self.token)
profile = mhpEnergyBalanceFree(e)
assert isinstance(profile, mhpEnergyBalanceFree)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Precio medio cuarto horario componente incumplimiento energía de balance contratación libre')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio cuarto horario componente incumplimiento energía de balance contratación libre')
)
with it('Returns mhpEnergyBalanceCUR instance'):
#1367
e = Esios(self.token)
profile = mhpEnergyBalanceCUR(e)
assert isinstance(profile, mhpEnergyBalanceCUR)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Precio medio qh de balance comercializadores de referencia')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio cuarto horario componente incumplimiento energía de balance comercializadores de referencia')
)
with it('Returns mhpEnergyBalanceInc instance'):
# 1368
e = Esios(self.token)
profile = mhpEnergyBalanceInc(e)
assert isinstance(profile, mhpEnergyBalanceInc)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Precio medio cuarto horario componente incumplimiento energ\xeda de balance')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio cuarto horario componente incumplimiento energ\xeda de balance')
)
with it('Returns PriceMedioHorarioMAJ3total instance'):
# 1901
e = Esios(self.token)
profile = PriceMedioHorarioMAJ3total(e)
assert isinstance(profile, PriceMedioHorarioMAJ3total)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Mecanismo de ajuste TOT_MAJ3')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio horario componente RD-L 10/2022 restricciones t\xe9cnicas y mercados de balance ')
)
with it('Returns PriceMedioHorarioMAJ3nocur instance'):
# 1902
e = Esios(self.token)
profile = PriceMedioHorarioMAJ3nocur(e)
assert isinstance(profile, PriceMedioHorarioMAJ3nocur)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Mecanismo de ajuste CLI_MAJ3')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio horario componente RD-L 10/2022 restricciones t\xe9cnicas y mercados de balance contrataci\xf3n libre')
)
with it('Returns PriceMedioHorarioMAJ3cur instance'):
# 1903
e = Esios(self.token)
profile = PriceMedioHorarioMAJ3cur(e)
assert isinstance(profile, PriceMedioHorarioMAJ3cur)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Mecanismo de ajuste CUR_MAJ3')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio horario componente RD-L 10/2022 restricciones t\xe9cnicas y mercados de balance comercializadores de referencia')
)
with it('Returns PriceMedioHorarioAJOStotal instance'):
# 1904
e = Esios(self.token)
profile = PriceMedioHorarioAJOStotal(e)
assert isinstance(profile, PriceMedioHorarioAJOStotal)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Mecanismo de ajuste TOT_AJOS')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio horario componente RD-L 10/2022 mercado diario e intradiario - diferencia por liquidaci\xf3n con medidas')
)
with it('Returns PriceMedioHorarioAJOSnocur instance'):
# 1905
e = Esios(self.token)
profile = PriceMedioHorarioAJOSnocur(e)
assert isinstance(profile, PriceMedioHorarioAJOSnocur)
data = profile.get(self.start_date, self.end_date)
expect(data['indicator']['short_name']).to(
equal(u'Mecanismo de ajuste CLI_AJOS')
)
expect(data['indicator']['name']).to(
contain(u'Precio medio horario componente RD-L 10/2022 mercado diario e intradiario - dif. por liq. con medidas contrataci\xf3n libre')
)
with it('Returns PriceMedioHorarioAJOScur instance'):
# 1906
e = Esios(self.token)