# collapse_hidedf_run = pd.DataFrame()for xp in r_xp.json(): experiment_id = xp["experiment_id"] url=URL +"/runs/experiment/"+ experiment_idprint(xp["name"], url) r = requests.get(url, timeout=2)assert r.status_code ==200# We keep only the N last runfor run in r.json()[-2:]: run_id = run["id"] page =1#while True:while page<3: url = URL +"/emissions/run/"+ run_id +"?size=1000&page="+str(page) r = requests.get(url=url, timeout=30)assert r.status_code ==200if r.json()["items"] == []:break df_last_run = pd.DataFrame(r.json()["items"])print(f"Il y a {len(df_last_run)} émissions dans {url}") df_last_run["datacenter"] = xp["name"] df_run = pd.concat([df_run, df_last_run]) page +=1df_run.head(1)df_run.tail(1)
DC5 https://api.codecarbon.io/runs/experiment/0bfa2432-efda-4656-bdb4-f72d15866b0b
Il y a 102 émissions dans https://api.codecarbon.io/emissions/run/09762fc4-08e5-4f9f-b796-bddd90e7fdad?size=1000&page=1
Il y a 1000 émissions dans https://api.codecarbon.io/emissions/run/8d2890eb-8e64-4271-9bc9-61b6860b0345?size=1000&page=1
Il y a 1000 émissions dans https://api.codecarbon.io/emissions/run/8d2890eb-8e64-4271-9bc9-61b6860b0345?size=1000&page=2
DC2 https://api.codecarbon.io/runs/experiment/ea060644-5303-4a68-8fb2-d0902b269022
Il y a 1000 émissions dans https://api.codecarbon.io/emissions/run/63ec8a01-e03b-4130-b101-9a4c084f0ddd?size=1000&page=1
Il y a 1000 émissions dans https://api.codecarbon.io/emissions/run/63ec8a01-e03b-4130-b101-9a4c084f0ddd?size=1000&page=2
Il y a 1000 émissions dans https://api.codecarbon.io/emissions/run/00d90dd0-6b6c-4ceb-9a8d-78c34cfe48b1?size=1000&page=1
Il y a 1000 émissions dans https://api.codecarbon.io/emissions/run/00d90dd0-6b6c-4ceb-9a8d-78c34cfe48b1?size=1000&page=2