Adrien Banse
commited on
Commit
โข
f236326
1
Parent(s):
9c47a26
feat: existing electricity mixes
Browse files- app.py +31 -8
- data/electricity_mix.csv +4 -0
- data/mixes.py +154 -0
app.py
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
-
from typing import Optional
|
2 |
import gradio as gr
|
3 |
from pint import UnitRegistry
|
4 |
|
|
|
|
|
5 |
from ecologits.tracers.utils import compute_llm_impacts, _avg
|
6 |
from ecologits.impacts.llm import compute_llm_impacts as compute_llm_impacts_expert
|
7 |
from ecologits.impacts.llm import IF_ELECTRICITY_MIX_GWP, IF_ELECTRICITY_MIX_ADPE, IF_ELECTRICITY_MIX_PE
|
@@ -48,7 +49,6 @@ MODELS = [
|
|
48 |
("Cohere / Command R+", "cohere/command-r-plus"),
|
49 |
]
|
50 |
|
51 |
-
|
52 |
PROMPTS = [
|
53 |
("Write a Tweet", 50),
|
54 |
("Write an email", 170),
|
@@ -146,6 +146,11 @@ def model_total_params_fn(model_name: str, n_param: float):
|
|
146 |
model = models.find_model(provider=provider, model_name=model_name)
|
147 |
return model.total_parameters or _avg(model.total_parameters_range)
|
148 |
|
|
|
|
|
|
|
|
|
|
|
149 |
with gr.Blocks() as demo:
|
150 |
|
151 |
### TITLE
|
@@ -244,18 +249,34 @@ with gr.Blocks() as demo:
|
|
244 |
label="Output tokens",
|
245 |
value=100
|
246 |
)
|
247 |
-
|
248 |
-
|
249 |
-
|
|
|
|
|
|
|
|
|
250 |
)
|
251 |
mix_adpe = gr.Number(
|
252 |
label="Electricity mix - Abiotic resources [kgSbeq / kWh]",
|
253 |
-
value=IF_ELECTRICITY_MIX_ADPE
|
|
|
254 |
)
|
255 |
mix_pe = gr.Number(
|
256 |
label="Electricity mix - Primary energy [MJ / kWh]",
|
257 |
-
value=IF_ELECTRICITY_MIX_PE
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
)
|
|
|
|
|
|
|
|
|
|
|
259 |
|
260 |
with gr.Row():
|
261 |
energy = gr.Markdown(
|
@@ -314,7 +335,9 @@ with gr.Blocks() as demo:
|
|
314 |
|
315 |
### METHOD QUICK EXPLANATION
|
316 |
with gr.Tab('Methodology'):
|
317 |
-
gr.Markdown("""๐
|
|
|
|
|
318 |
|
319 |
### INFORMATION ABOUT INDICATORS
|
320 |
with gr.Accordion("๐ More about the indicators", open = False):
|
|
|
|
|
1 |
import gradio as gr
|
2 |
from pint import UnitRegistry
|
3 |
|
4 |
+
from data.mixes import MIXES, find_mix
|
5 |
+
|
6 |
from ecologits.tracers.utils import compute_llm_impacts, _avg
|
7 |
from ecologits.impacts.llm import compute_llm_impacts as compute_llm_impacts_expert
|
8 |
from ecologits.impacts.llm import IF_ELECTRICITY_MIX_GWP, IF_ELECTRICITY_MIX_ADPE, IF_ELECTRICITY_MIX_PE
|
|
|
49 |
("Cohere / Command R+", "cohere/command-r-plus"),
|
50 |
]
|
51 |
|
|
|
52 |
PROMPTS = [
|
53 |
("Write a Tweet", 50),
|
54 |
("Write an email", 170),
|
|
|
146 |
model = models.find_model(provider=provider, model_name=model_name)
|
147 |
return model.total_parameters or _avg(model.total_parameters_range)
|
148 |
|
149 |
+
def mix_fn(country_code: str, mix_adpe: float, mix_pe: float, mix_gwp: float):
|
150 |
+
if country_code == CUSTOM:
|
151 |
+
return mix_gwp, mix_adpe, mix_pe
|
152 |
+
return find_mix(country_code)
|
153 |
+
|
154 |
with gr.Blocks() as demo:
|
155 |
|
156 |
### TITLE
|
|
|
249 |
label="Output tokens",
|
250 |
value=100
|
251 |
)
|
252 |
+
|
253 |
+
mix = gr.Dropdown(
|
254 |
+
MIXES + [CUSTOM],
|
255 |
+
label="Location",
|
256 |
+
value="WOR",
|
257 |
+
filterable=True,
|
258 |
+
interactive=True
|
259 |
)
|
260 |
mix_adpe = gr.Number(
|
261 |
label="Electricity mix - Abiotic resources [kgSbeq / kWh]",
|
262 |
+
value=IF_ELECTRICITY_MIX_ADPE,
|
263 |
+
interactive=True
|
264 |
)
|
265 |
mix_pe = gr.Number(
|
266 |
label="Electricity mix - Primary energy [MJ / kWh]",
|
267 |
+
value=IF_ELECTRICITY_MIX_PE,
|
268 |
+
interactive=True
|
269 |
+
)
|
270 |
+
mix_gwp = gr.Number(
|
271 |
+
label="Electricity mix - GHG emissions [kgCO2eq / kWh]",
|
272 |
+
value=IF_ELECTRICITY_MIX_GWP,
|
273 |
+
interactive=True
|
274 |
)
|
275 |
+
|
276 |
+
mix.change(fn=mix_fn, inputs=[mix, mix_adpe, mix_pe, mix_gwp], outputs=[mix_adpe, mix_pe, mix_gwp])
|
277 |
+
mix_adpe.input(fn=custom, outputs=mix)
|
278 |
+
mix_pe.input(fn=custom, outputs=mix)
|
279 |
+
mix_gwp.input(fn=custom, outputs=mix)
|
280 |
|
281 |
with gr.Row():
|
282 |
energy = gr.Markdown(
|
|
|
335 |
|
336 |
### METHOD QUICK EXPLANATION
|
337 |
with gr.Tab('Methodology'):
|
338 |
+
gr.Markdown("""## ๐ Methodology
|
339 |
+
๐ง Under construction
|
340 |
+
""")
|
341 |
|
342 |
### INFORMATION ABOUT INDICATORS
|
343 |
with gr.Accordion("๐ More about the indicators", open = False):
|
data/electricity_mix.csv
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name,unit,source,WOR,EEE,ZWE,ZMB,ZAF,YEM,VNM,VEN,UZB,URY,USA,UKR,TZA,TWN,TTO,TUR,TUN,TKM,TJK,THA,TGO,SYR,SLV,SEN,SVK,SVN,SGP,SWE,SDN,SAU,RUS,SCG,ROU,QAT,PRY,PRT,POL,PAK,PHL,PER,PAN,OMN,NZL,NPL,NOR,NLD,NIC,NGA,NAM,MOZ,MYS,MEX,MLT,MNG,MMR,MKD,MDA,MAR,LBY,LVA,LUX,LTU,LKA,LBN,KAZ,KWT,KOR,PRK,KHM,KGZ,KEN,JPN,JOR,JAM,ITA,ISL,IRN,IRQ,IND,ISR,IRL,IDN,HUN,HTI,HRV,HND,HKG,GTM,GRC,GIB,GHA,GEO,GBR,GAB,FRA,FIN,ETH,ESP,ERI,EGY,EST,ECU,DZA,DOM,DNK,DEU,CZE,CYP,CUB,CRI,COL,CHN,CMR,CHL,CIV,CHE,COG,COD,CAN,BLR,BWA,BRA,BOL,BRN,BEN,BHR,BGR,BEL,BGD,BIH,AZE,AUS,AUT,ARG,AGO,ANT,ARM,ALB,ARE
|
2 |
+
adpe,kg รฉq. Sb,ADEME Base IMPACTS ยฎ,0.0000000737708,0.0000000642317,0.000000109502,0.000000162193,0.0000000862445,0.0000000163908,0.0000000945573,0.000000112811,0.000000103681,0.000000104586,0.0000000985548,0.0000000647907,0.000000132261,0.0000000578088,0.000000064552,0.0000000749765,0.0000000177021,0.000000131822,0.000000152621,0.0000000569593,0.000000134255,0.0000000268396,0.0000000472135,0.0000000470662,0.0000000606109,0.0000000992283,0.0000000198459,0.0000000777062,0.0000000955701,0.0000000134206,0.0000000960312,0.000000132772,0.0000000981761,0.00000001324,0.000000149181,0.0000000341863,0.000000101946,0.0000000842952,0.0000000595304,0.0000000952688,0.0000000790553,0.0000000374073,0.0000000720474,0.000000238273,0.000000127486,0.0000000329318,0.0000000414983,0.0000000621,0.000000128285,0.000000148382,0.000000044938,0.0000000578358,0.000000049475,0.000000176361,0.000000152699,0.000000119873,0.000000110674,0.0000000641089,0.0000000206592,0.000000153757,0.000000105692,0.0000000294596,0.0000000986932,0.0000000182134,0.000000135386,0.0000000141168,0.0000000518017,0.000000117457,0.0000000319202,0.000000181827,0.0000000958533,0.0000000596578,0.0000000147031,0.0000000196047,0.00000005439,0.0000000781905,0.0000000220304,0.0000000404306,0.000000100099,0.0000000610194,0.0000000219257,0.0000000610451,0.0000000644587,0.0000000937057,0.000000153989,0.0000000649373,0.0000000816213,0.0000000803251,0.0000000691645,0.0000000286211,0.000000156003,0.000000137999,0.0000000370973,0.000000113843,0.0000000485798,0.0000000805114,0.000000174161,0.0000000518326,0.0000000512406,0.000000033925,0.0000000990171,0.000000127168,0.0000000216438,0.0000000429285,0.0000000157411,0.0000000878733,0.0000000817565,0.0000000448771,0.0000000299542,0.0000000863908,0.000000122031,0.0000000851552,0.000000146313,0.000000105851,0.0000000949004,0.000000100467,0.000000265575,0.000000174647,0.0000000993179,0.0000000840478,0.0000000866014,0.00000010962,0.0000000969793,0.0000000185641,0.0000000239702,0.0000000135014,0.0000000823611,0.0000000337201,0.0000000394158,0.000000148007,0.000000092567,0.0000000790846,0.000000141124,0.0000000768612,0.000000124074,0.0000000449103,0.0000000854245,0.000000229556,0.0000000141548
|
3 |
+
pe,MJ,ADPf / (1-%renewable_energy),9.988,12.873,16.122,1.798,11.732,16.250,11.238,15.163,17.367,107.570,11.358,12.936,9.305,11.439,14.289,16.150,12.902,23.300,19.165,10.414,21.978,16.989,13.012,14.516,11.680,12.146,10.477,11.026,29.629,14.058,13.200,14.242,15.585,11.916,0.020,14.153,13.178,16.175,11.120,8.211,16.364,22.306,24.731,0.396,4.952,8.511,24.696,11.279,468.150,0.206,12.268,11.775,19.374,15.114,14.132,19.120,18.429,11.702,19.116,8.249,10.128,21.043,12.116,12.341,13.260,12.753,10.199,32.793,34.655,15.380,68.996,10.718,13.677,14.799,12.656,0.013,15.022,20.372,20.363,10.023,10.706,11.603,11.784,20.167,18.548,15.762,,14.340,14.487,,10.097,10.425,13.579,28.341,11.289,11.275,36.133,12.090,13.289,10.195,16.334,20.908,16.376,12.412,16.824,16.260,12.517,13.118,17.317,45.996,7.312,14.119,10.807,11.348,14.783,11.782,34.147,0.097,11.987,13.194,19.642,9.031,11.587,15.689,14.337,14.036,14.375,10.776,12.935,21.705,12.831,16.908,11.036,10.049,16.972,,13.380,0.201,19.032
|
4 |
+
gwp,kg รฉq. CO2,ADEME Base IMPACTS ยฎ,0.590478,0.509427,0.842811,0.0141304,1.17562,1.06777,0.555572,0.497373,0.81178,0.296953,0.67978,0.646745,0.475635,0.845351,0.933059,0.706988,0.80722,1.38296,0.0426743,0.646174,0.545455,1.08778,0.473128,1.1195,0.309341,0.498523,0.655825,0.0464664,1.12472,0.913677,0.66131,1.07808,0.664245,0.722125,0.241601,0.571172,1.15075,0.748727,0.761317,0.284364,0.53403,1.41292,0.293397,0.0841323,0.023754,0.544803,0.941626,0.693123,0.357253,0.00880732,0.832206,0.739214,1.31149,1.47192,0.48193,1.24074,1.04213,0.933694,1.35361,0.234273,0.490016,0.154229,0.709185,0.883627,1.128,0.885084,0.599585,0.797361,1.41054,0.156039,0.589603,0.540891,0.781372,1.07345,0.621329,0.0194609,0.930385,1.48728,1.58299,0.901842,0.648118,0.875394,0.541558,1.3858,0.535759,0.692837,0.95888,0.645801,1.13127,0.977477,0.540126,0.132046,0.602137,0.732511,0.0813225,0.322068,0.251299,0.467803,1.13153,0.587775,1.51492,0.627714,1.02318,0.909252,0.633534,0.657374,0.799077,0.978041,1.28325,0.224471,0.214014,1.05738,0.456622,0.574415,0.928583,0.0448568,0.904053,0.0613102,0.238191,0.795697,2.12572,0.278647,0.585131,0.997577,1.19128,0.804567,0.827087,0.256537,0.795168,1.56025,0.726126,1.12326,0.245573,0.476811,0.412014,1.13161,0.252002,0.0207635,1.09088
|
data/mixes.py
ADDED
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from csv import DictReader
|
2 |
+
|
3 |
+
PATH = "data/electricity_mix.csv"
|
4 |
+
MIXES = [
|
5 |
+
("๐ World", "WOR"),
|
6 |
+
("๐ช๐บ Europe", "EEE"),
|
7 |
+
("๐ฟ๐ผ Zimbabwe", "ZWE"),
|
8 |
+
("๐ฟ๐ฒ Zambia", "ZMB"),
|
9 |
+
("๐ฟ๐ฆ South Africa", "ZAF"),
|
10 |
+
("๐พ๐ช Yemen", "YEM"),
|
11 |
+
("๐ป๐ณ Vietnam", "VNM"),
|
12 |
+
("๐ป๐ช Venezuela", "VEN"),
|
13 |
+
("๐บ๐ฟ Uzbekistan", "UZB"),
|
14 |
+
("๐บ๐พ Uruguay", "URY"),
|
15 |
+
("๐บ๐ธ United States", "USA"),
|
16 |
+
("๐บ๐ฆ Ukraine", "UKR"),
|
17 |
+
("๐น๐ฟ Tanzania", "TZA"),
|
18 |
+
("๐น๐ผ Taiwan", "TWN"),
|
19 |
+
("๐น๐น Trinidad and Tobago", "TTO"),
|
20 |
+
("๐น๐ท Turkey", "TUR"),
|
21 |
+
("๐น๐ณ Tunisia", "TUN"),
|
22 |
+
("๐น๐ฒ Turkmenistan", "TKM"),
|
23 |
+
("๐น๐ฏ Tajikistan", "TJK"),
|
24 |
+
("๐น๐ญ Thailand", "THA"),
|
25 |
+
("๐น๐ฌ Togo", "TGO"),
|
26 |
+
("๐ธ๐พ Syrian Arab Republic", "SYR"),
|
27 |
+
("๐ธ๐ป El Salvador", "SLV"),
|
28 |
+
("๐ธ๐ณ Senegal", "SEN"),
|
29 |
+
("๐ธ๐ฐ Slovak Republic", "SVK"),
|
30 |
+
("๐ธ๐ฎ Slovenia", "SVN"),
|
31 |
+
("๐ธ๐ฌ Singapore", "SGP"),
|
32 |
+
("๐ธ๐ช Sweden", "SWE"),
|
33 |
+
("๐ธ๐ฉ Sudan", "SDN"),
|
34 |
+
("๐ธ๐ฆ Saudi Arabia", "SAU"),
|
35 |
+
("๐ท๐บ Russian Federation", "RUS"),
|
36 |
+
("๐ท๐ธ Serbia and Montenegro", "SCG"),
|
37 |
+
("๐ท๐ด Romania", "ROU"),
|
38 |
+
("๐ถ๐ฆ Qatar", "QAT"),
|
39 |
+
("๐ต๐พ Paraguay", "PRY"),
|
40 |
+
("๐ต๐น Portugal", "PRT"),
|
41 |
+
("๐ต๐ฑ Poland", "POL"),
|
42 |
+
("๐ต๐ฐ Pakistan", "PAK"),
|
43 |
+
("๐ต๐ญ Philippines", "PHL"),
|
44 |
+
("๐ต๐ช Peru", "PER"),
|
45 |
+
("๐ต๐ฆ Panama", "PAN"),
|
46 |
+
("๐ด๐ฒ Oman", "OMN"),
|
47 |
+
("๐ณ๐ฟ New Zealand", "NZL"),
|
48 |
+
("๐ณ๐ต Nepal", "NPL"),
|
49 |
+
("๐ณ๐ด Norway", "NOR"),
|
50 |
+
("๐ณ๐ฑ Netherlands", "NLD"),
|
51 |
+
("๐ณ๐ฎ Nicaragua", "NIC"),
|
52 |
+
("๐ณ๐ฌ Nigeria", "NGA"),
|
53 |
+
("๐ณ๐ฆ Namibia", "NAM"),
|
54 |
+
("๐ฒ๐ฟ Mozambique", "MOZ"),
|
55 |
+
("๐ฒ๐พ Malaysia", "MYS"),
|
56 |
+
("๐ฒ๐ฝ Mexico", "MEX"),
|
57 |
+
("๐ฒ๐น Malta", "MLT"),
|
58 |
+
("๐ฒ๐ณ Mongolia", "MNG"),
|
59 |
+
("๐ฒ๐ฒ Myanmar", "MMR"),
|
60 |
+
("๐ฒ๐ฐ North Macedonia", "MKD"),
|
61 |
+
("๐ฒ๐ฉ Moldova", "MDA"),
|
62 |
+
("๐ฒ๐ฆ Morocco", "MAR"),
|
63 |
+
("๐ฑ๐พ Libya", "LBY"),
|
64 |
+
("๐ฑ๐ป Latvia", "LVA"),
|
65 |
+
("๐ฑ๐บ Luxembourg", "LUX"),
|
66 |
+
("๐ฑ๐น Lithuania", "LTU"),
|
67 |
+
("๐ฑ๐ฐ Sri Lanka", "LKA"),
|
68 |
+
("๐ฑ๐ง Lebanon", "LBN"),
|
69 |
+
("๐ฐ๐ฟ Kazakhstan", "KAZ"),
|
70 |
+
("๐ฐ๐ผ Kuwait", "KWT"),
|
71 |
+
("๐ฐ๐ท South Korea", "KOR"),
|
72 |
+
("๐ฐ๐ต North Korea", "PRK"),
|
73 |
+
("๐ฐ๐ญ Cambodia", "KHM"),
|
74 |
+
("๐ฐ๐ฌ Kyrgyz Republic", "KGZ"),
|
75 |
+
("๐ฐ๐ช Kenya", "KEN"),
|
76 |
+
("๐ฏ๐ต Japan", "JPN"),
|
77 |
+
("๐ฏ๐ด Jordan", "JOR"),
|
78 |
+
("๐ฏ๐ฒ Jamaica", "JAM"),
|
79 |
+
("๐ฎ๐น Italy", "ITA"),
|
80 |
+
("๐ฎ๐ธ Iceland", "ISL"),
|
81 |
+
("๐ฎ๐ท Iran", "IRN"),
|
82 |
+
("๐ฎ๐ถ Iraq", "IRQ"),
|
83 |
+
("๐ฎ๐ณ India", "IND"),
|
84 |
+
("๐ฎ๐ฑ Israel", "ISR"),
|
85 |
+
("๐ฎ๐ช Ireland", "IRL"),
|
86 |
+
("๐ฎ๐ฉ Indonesia", "IDN"),
|
87 |
+
("๐ญ๐บ Hungary", "HUN"),
|
88 |
+
("๐ญ๐น Haiti", "HTI"),
|
89 |
+
("๐ญ๐ท Croatia", "HRV"),
|
90 |
+
("๐ญ๐ณ Honduras", "HND"),
|
91 |
+
("๐ญ๐ฐ Hong Kong", "HKG"),
|
92 |
+
("๐ฌ๐น Guatemala", "GTM"),
|
93 |
+
("๐ฌ๐ท Greece", "GRC"),
|
94 |
+
("๐ฌ๐ฎ Gibraltar", "GIB"),
|
95 |
+
("๐ฌ๐ญ Ghana", "GHA"),
|
96 |
+
("๐ฌ๐ช Georgia", "GEO"),
|
97 |
+
("๐ฌ๐ง United Kingdom", "GBR"),
|
98 |
+
("๐ฌ๐ฆ Gabon", "GAB"),
|
99 |
+
("๐ซ๐ท France", "FRA"),
|
100 |
+
("๐ซ๐ฎ Finland", "FIN"),
|
101 |
+
("๐ช๐น Ethiopia", "ETH"),
|
102 |
+
("๐ช๐ธ Spain", "ESP"),
|
103 |
+
("๐ช๐ท Eritrea", "ERI"),
|
104 |
+
("๐ช๐ฌ Egypt", "EGY"),
|
105 |
+
("๐ช๐ช Estonia", "EST"),
|
106 |
+
("๐ช๐จ Ecuador", "ECU"),
|
107 |
+
("๐ฉ๐ฟ Algeria", "DZA"),
|
108 |
+
("๐ฉ๐ด Dominican Republic", "DOM"),
|
109 |
+
("๐ฉ๐ฐ Denmark", "DNK"),
|
110 |
+
("๐ฉ๐ช Germany", "DEU"),
|
111 |
+
("๐จ๐ฟ Czech Republic", "CZE"),
|
112 |
+
("๐จ๐พ Cyprus", "CYP"),
|
113 |
+
("๐จ๐บ Cuba", "CUB"),
|
114 |
+
("๐จ๐ท Costa Rica", "CRI"),
|
115 |
+
("๐จ๐ด Colombia", "COL"),
|
116 |
+
("๐จ๐ณ China", "CHN"),
|
117 |
+
("๐จ๐ฒ Cameroon", "CMR"),
|
118 |
+
("๐จ๐ฑ Chile", "CHL"),
|
119 |
+
("๐จ๐ฎ Cote d'Ivoire", "CIV"),
|
120 |
+
("๐จ๐ญ Switzerland", "CHE"),
|
121 |
+
("๐จ๐ฌ Congo", "COG"),
|
122 |
+
("๐จ๐ฉ Democratic Republic of the Congo", "COD"),
|
123 |
+
("๐จ๐ฆ Canada", "CAN"),
|
124 |
+
("๐ง๐พ Belarus", "BLR"),
|
125 |
+
("๐ง๐ผ Botswana", "BWA"),
|
126 |
+
("๐ง๐ท Brazil", "BRA"),
|
127 |
+
("๐ง๐ด Bolivia", "BOL"),
|
128 |
+
("๐ง๐ณ Brunei", "BRN"),
|
129 |
+
("๐ง๐ฏ Benin", "BEN"),
|
130 |
+
("๐ง๐ญ Bahrain", "BHR"),
|
131 |
+
("๐ง๐ฌ Bulgaria", "BGR"),
|
132 |
+
("๐ง๐ช Belgium", "BEL"),
|
133 |
+
("๐ง๐ฉ Bangladesh", "BGD"),
|
134 |
+
("๐ง๐ฆ Bosnia and Herzegovina", "BIH"),
|
135 |
+
("๐ฆ๐ฟ Azerbaijan", "AZE"),
|
136 |
+
("๐ฆ๐บ Australia", "AUS"),
|
137 |
+
("๐ฆ๐น Austria", "AUT"),
|
138 |
+
("๐ฆ๐ท Argentina", "ARG"),
|
139 |
+
("๐ฆ๐ด Angola", "AGO"),
|
140 |
+
("๐ฆ Netherlands Antilles", "ANT"),
|
141 |
+
("๐ฆ๐ฒ Armenia", "ARM"),
|
142 |
+
("๐ฆ๐ฑ Albania", "ALB"),
|
143 |
+
("๐ฆ๐ช United Arab Emirates", "ARE")
|
144 |
+
]
|
145 |
+
|
146 |
+
def find_mix(code: str):
|
147 |
+
# TODO: Maybe more optimal to construct database at the beginning of the app
|
148 |
+
# in the same fashion as find_model
|
149 |
+
res = []
|
150 |
+
with open(PATH) as fd:
|
151 |
+
csv = DictReader(fd)
|
152 |
+
for row in csv:
|
153 |
+
res += [float(row[code])]
|
154 |
+
return res
|