Skip to content

Commit

Permalink
Fix B
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Apr 3, 2024
1 parent 418cf96 commit 89b30bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions carculator_utils/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def calculate_impacts(self, sensitivity=False):
year=self.scope["year"], kwargs={"fill_value": "extrapolate"}
).values
else:
B = self.B[0].values
B = self.B.values

# Prepare an array to store the results
results = self.get_results_table(sensitivity=sensitivity)
Expand Down Expand Up @@ -701,7 +701,8 @@ def get_B_matrix(self) -> xr.DataArray:
if all(x in str(fp) for x in [self.method, self.indicator, self.scenario])
]

filepaths = sorted(filepaths, key=lambda x: int(x[-8:-4]))
if self.scenario != "static":
filepaths = sorted(filepaths, key=lambda x: int(x[-8:-4]))

B = np.zeros((len(filepaths), len(self.impact_categories), len(self.inputs)))

Expand Down

0 comments on commit 89b30bf

Please sign in to comment.