Skip to content

Instantly share code, notes, and snippets.

@systemcatch
systemcatch / eiapy_examples.py
Last active October 2, 2018 15:33
A variety of examples for eiapy
# Find 5 years of data for Federal oil & gas production in the Gulf of Mexico.
gulf_category = Category(296728).get_info()
# Find all child series and make a list of them.
gulf_childseries = gulf_category['category']['childseries']
gulf_series_ids = [i['series_id'] for i in gulf_childseries]
data = MultiSeries(gulf_series_ids).last(5)
@systemcatch
systemcatch / iraq_generation
Created June 3, 2018 10:33
Sample data for Iraq power generation
{"d":{"d_1000":0,"d_1001":0,"d_1002":0,"d_1003":0,"d_1004":0,"d_1005":0,"d_1006":0,"d_1007":0,"d_1008":0,"d_1009":0,
"d_1010":0,"d_1011":0,"d_1012":0,"d_1013":0,"d_1014":0,"d_1015":0,"d_1016":0,"d_1017":0,"d_1018":0,"d_1019":0,
"d_1020":0,"d_1021":0,"d_1022":0,"d_1023":0,"d_1024":0,"d_1025":0,"d_1026":0,"d_1027":195,"d_1028":0,"d_1029":198.6,
"d_1030":393.6,"d_1031":7,"d_1032":14,"d_1033":14.8,"d_1034":16,"d_1035":0,"d_1036":21,"d_1037":0,"d_1038":0,"d_1039":0,
"d_1040":20,"d_1041":15,"d_1042":15,"d_1043":122.8,"d_1044":0,"d_1045":0,"d_1046":0,"d_1047":0,"d_1048":85,"d_1049":0,
"d_1050":0,"d_1051":24,"d_1052":79.3,"d_1053":0,"d_1054":0,"d_1055":51.1,"d_1056":11.4,"d_1057":10.3,"d_1058":0,"d_1059":0,
"d_1060":16.2,"d_1061":20.4,"d_1062":58.3,"d_1063":5,"d_1064":0,"d_1065":45,"d_1066":44,"d_1067":13,"d_1068":17.9,
"d_1069":0,"d_1070":0,"d_1071":0.6,"d_1072":76.7,"d_1073":25.4,"d_1074":54.1,"d_1075":0,"d_1076":76.9,"d_1077":81.9,
"d_1078":78.4,"d_1079":77.4,"d_1080
@systemcatch
systemcatch / thermal_plants.txt
Last active January 20, 2018 21:36
Mapping of power plants to type for the SIC grid region of Chile
thermal_plants = {
"Taltal 2 GNL": "",
"Taltal 2": "",
"Taltal 2 Diesel": "",
"Taltal 1 GNL": "",
"Taltal 1": "",
"Taltal 1 Diesel": "",
"Diego de Almagro": "",
"El Salvador": "",
"Guacolda 1": "",
@systemcatch
systemcatch / validator.py
Created September 11, 2017 08:08
Idea for production validation
def validate(data, **kwargs):
"""
Validates a production datapoint based on given constraints.
By default this will change type values that are negative to None.
If the datapoint is found to be invalid then the production key
is changed to the following.
data['production'] = None
Optional Arguments:
@systemcatch
systemcatch / PH_plant_map.py
Created September 5, 2017 22:38
Mapping of PH Plant ID's to type
Luzon = {
'1SUAL_G01': 'coal',
'3ILIJAN_G02': 'gas',
'3ILIJAN_G01': 'gas',
'3QPPL_G01': 'coal',
'1MARVEL_G02': 'coal',
'3PAGBIL_G01': 'coal',
'3CALACA_G02': 'coal',
'3CALACA_G01': 'coal',
'1MSINLO_G02': 'coal',
@systemcatch
systemcatch / cr_plants.py
Created August 1, 2017 18:05
Costa Rica Power Plants
power_plants = {
'Aeroenergía': 'wind',
'Altamira': 'wind',
'Angostura': 'hydro',
'Arenal': 'hydro',
'Balsa Inferior': 'hydro',
'Barranca': 'unknown',
'Barro Morado': 'geothermal',
'Bijagua': 'hydro',
'Birris12': 'hydro',