Skip to content

Commit

Permalink
Remove flip array for B matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Apr 2, 2024
1 parent c65f079 commit 1ee4b33
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
1 change: 0 additions & 1 deletion pathways/lca.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ def get_lca_matrices(
matrix="biosphere_matrix",
indices_array=b_indices,
data_array=b_data,
flip_array=b_sign,
distributions_array=b_distributions,
)

Expand Down
27 changes: 13 additions & 14 deletions pathways/pathways.py
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,7 @@ def fill_in_result_array(self, results: dict):
summed_data = d[..., idx].sum(axis=-1)

if idx.size > 0:

try:
self.lca_results.loc[
{
Expand All @@ -946,20 +947,18 @@ def fill_in_result_array(self, results: dict):
] = summed_data

except:
print("summed data shape", summed_data.shape)
print(
self.lca_results.loc[
{
"region": region,
"model": model,
"scenario": scenario,
"year": year,
"act_category": cat,
"location": loc,
"variable": list(variables.keys()),
}
].shape
)
# transpose quantile dimension to the penultimate dimension
self.lca_results.loc[
{
"region": region,
"model": model,
"scenario": scenario,
"year": year,
"act_category": cat,
"location": loc,
"variable": list(variables.keys()),
}
] = summed_data.transpose(0, 2, 1)

def characterize_planetary_boundaries(
self,
Expand Down

0 comments on commit 1ee4b33

Please sign in to comment.