Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Aug 21, 2023
2 parents 15ef025 + 981525c commit 753dfa6
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions premise/data_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,9 @@ def __get_carbon_capture_rate(
# if variable is missing, we assume that the rate is 0
# and that none of the CO2 emissions are captured

if not any(x in data.variables.values.tolist() for x in dict_vars.get("cement - cco2")):
if not any(
x in data.variables.values.tolist() for x in dict_vars.get("cement - cco2")
):
cement_rate = xr.DataArray(
np.zeros((len(data.region), len(data.year))),
coords=[data.region, data.year],
Expand All @@ -901,7 +903,9 @@ def __get_carbon_capture_rate(

cement_rate.coords["variables"] = "cement"

if not any(x in data.variables.values.tolist() for x in dict_vars.get("steel - cco2")):
if not any(
x in data.variables.values.tolist() for x in dict_vars.get("steel - cco2")
):
steel_rate = xr.DataArray(
np.zeros((len(data.region), len(data.year))),
coords=[data.region, data.year],
Expand All @@ -925,7 +929,9 @@ def __get_carbon_capture_rate(
# as it is sometimes neglected in the
# IAM files

if not any(x in data.variables.values.tolist() for x in dict_vars.get("cement - cco2")):
if not any(
x in data.variables.values.tolist() for x in dict_vars.get("cement - cco2")
):
rate.loc[dict(region="World", variables="cement")] = 0
else:
try:
Expand Down Expand Up @@ -967,7 +973,9 @@ def __get_carbon_capture_rate(
except ZeroDivisionError:
rate.loc[dict(region="World", variables="steel")] = 0

if not any(x in data.variables.values.tolist() for x in dict_vars.get("steel - cco2")):
if not any(
x in data.variables.values.tolist() for x in dict_vars.get("steel - cco2")
):
rate.loc[dict(region="World", variables="steel")] = 0
else:
rate.loc[dict(region="World", variables="steel")] = (
Expand Down

0 comments on commit 753dfa6

Please sign in to comment.