Skip to content

Commit

Permalink
Black reformating
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Aug 17, 2023
1 parent f92434f commit 032fa7b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
15 changes: 9 additions & 6 deletions premise/data_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,9 @@ def __init__(
self.steel_markets = self.__fetch_market_data(
data=data, input_vars=steel_prod_vars, system_model="cutoff"
)
self.dac_markets = self.__fetch_market_data(data=data, input_vars=dac_prod_vars, system_model="cutoff")
self.dac_markets = self.__fetch_market_data(
data=data, input_vars=dac_prod_vars, system_model="cutoff"
)
self.biomass_markets = self.__fetch_market_data(
data=data, input_vars=biomass_prod_vars, system_model="cutoff"
)
Expand All @@ -499,10 +501,7 @@ def __init__(
)

self.other_vars = self.__fetch_market_data(
data=data,
input_vars=other_vars,
normalize=False,
system_model = "cutoff"
data=data, input_vars=other_vars, normalize=False, system_model="cutoff"
)

self.electricity_efficiencies = self.get_iam_efficiencies(
Expand Down Expand Up @@ -714,7 +713,11 @@ def __get_iam_data(
return array

def __fetch_market_data(
self, data: xr.DataArray, input_vars: dict, system_model: str, normalize: bool = True,
self,
data: xr.DataArray,
input_vars: dict,
system_model: str,
normalize: bool = True,
) -> [xr.DataArray, None]:
"""
This method retrieves the market share for each technology,
Expand Down
5 changes: 4 additions & 1 deletion premise/electricity.py
Original file line number Diff line number Diff line change
Expand Up @@ -1506,7 +1506,10 @@ def create_biomass_markets(self) -> None:
0,
1,
)
elif self.system_model == "consequential" and biomass_type == "biomass - residual":
elif (
self.system_model == "consequential"
and biomass_type == "biomass - residual"
):
share = 0
else:
share = 0
Expand Down
6 changes: 3 additions & 3 deletions premise/fuels.py
Original file line number Diff line number Diff line change
Expand Up @@ -2197,9 +2197,9 @@ def generate_regional_fuel_market(
# if the sum is zero, we need to select a provider

if (
self.iam_fuel_markets.sel(
region=region, variables=prod_vars
).interp(year=self.year).sum(dim=["variables"])
self.iam_fuel_markets.sel(region=region, variables=prod_vars)
.interp(year=self.year)
.sum(dim=["variables"])
== 0
):
print("No fuel market for", dataset["name"], "in", region)
Expand Down
1 change: 0 additions & 1 deletion premise/marginal_mixes.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def get_leadtime(list_tech: Tuple) -> np.ndarray:
)
dict_ = {k: dict_[k] for k in list(list_tech)}


return np.array(list(dict_.values()), dtype=float)


Expand Down

0 comments on commit 032fa7b

Please sign in to comment.