Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pandas 2.0 fixes #77

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion experiment_impact_tracker/compute_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
import pandas as pd
import psutil
import ujson as json
from pandas.io.json import json_normalize
try:
from pandas.io.json import json_normalize
except ImportError:
from pandas import json_normalize

from experiment_impact_tracker.cpu import rapl
from experiment_impact_tracker.cpu.common import get_my_cpu_info
Expand Down
2 changes: 1 addition & 1 deletion experiment_impact_tracker/data_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
run_test)
from experiment_impact_tracker.utils import gather_additional_info

pd.set_option("display.max_colwidth", -1)
pd.set_option("display.max_colwidth", None)


def _gather_executive_summary(
Expand Down
6 changes: 5 additions & 1 deletion experiment_impact_tracker/data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
from datetime import datetime

import ujson as json
from pandas.io.json import json_normalize

try:
from pandas.io.json import json_normalize
except ImportError:
from pandas import json_normalize

BASE_LOG_PATH = "impacttracker/"
DATAPATH = BASE_LOG_PATH + "data.json"
Expand Down
10 changes: 5 additions & 5 deletions experiment_impact_tracker/emissions/rough_emissions_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self, gpu, cpu, gpu_utilization_factor, cpu_utilization_factor, loc
carbonIntensity = zone_info['carbonIntensity']
carbonIntensity_source = zone_info['_source']

gpu_kWh = kWh = float(self.gpu_vals['tdp']) * self.gpu_utilization_factor * (self.experiment_length_seconds /
gpu_kWh = kWh = float(self.gpu_vals['tdp'].iloc[0]) * self.gpu_utilization_factor * (self.experiment_length_seconds /
3600.)\
/ \
1000.
Expand Down Expand Up @@ -81,9 +81,9 @@ def __init__(self, gpu, cpu, gpu_utilization_factor, cpu_utilization_factor, loc
lower = ssc["16.7%"]
upper = ssc["83.3%"]

median_carbon_cost = (kg_carbon / 1000.) * float(median)
upper_carbon_cost = (kg_carbon / 1000.) * float(upper)
lower_carbon_cost = (kg_carbon / 1000.) * float(lower)
median_carbon_cost = (kg_carbon / 1000.) * float(median.iloc[0])
upper_carbon_cost = (kg_carbon / 1000.) * float(upper.iloc[0])
lower_carbon_cost = (kg_carbon / 1000.) * float(lower.iloc[0])

bibtex_nature = """
@article{ricke2018country,
Expand Down Expand Up @@ -145,4 +145,4 @@ def get_available_gpus(self):

@classmethod
def get_available_cpus(self):
return cpu_data["Model"].tolist()
return cpu_data["Model"].tolist()
2 changes: 1 addition & 1 deletion scripts/create-compute-appendix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ from experiment_impact_tracker.emissions.get_region_metrics import \
get_zone_name_by_id
from experiment_impact_tracker.utils import gather_additional_info

pd.set_option('display.max_colwidth', -1)
pd.set_option('display.max_colwidth', None)


def _gather_executive_summary(aggregated_info, executive_summary_variables, experiment_set_names, all_points=False):
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate-carbon-impact-statement
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ from experiment_impact_tracker.stats import (get_average_treatment_effect,
run_test)
from experiment_impact_tracker.utils import gather_additional_info

pd.set_option('display.max_colwidth', -1)
pd.set_option('display.max_colwidth', None)



Expand Down