Skip to content

Commit

Permalink
Merge pull request #113 from brightway-lca/figures
Browse files Browse the repository at this point in the history
Figures
  • Loading branch information
TimoDiepers authored Feb 6, 2025
2 parents aba493d + ea9217d commit fedff67
Show file tree
Hide file tree
Showing 3 changed files with 2,739 additions and 458 deletions.
8 changes: 3 additions & 5 deletions bw_timex/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,8 @@ def plot_characterized_inventory_as_waterfall(
"hour": "%Y-%m-%d %H",
}

# Grouping and summing data
plot_data = lca_obj.characterized_inventory.groupby(
["date", "activity"], as_index=False
).sum()
plot_data = lca_obj.characterized_inventory.copy()

plot_data["year"] = plot_data["date"].dt.strftime(
time_res_dict[lca_obj.temporal_grouping]
) # TODO make temporal resolution flexible
Expand All @@ -271,7 +269,7 @@ def plot_characterized_inventory_as_waterfall(
}
plot_data["activity_label"] = plot_data["activity"].map(activity_labels)

# Pivoting data for plotting
plot_data = plot_data.groupby(["year", "activity_label"], as_index=False)["amount"].sum()
pivoted_data = plot_data.pivot(
index="year", columns="activity_label", values="amount"
)
Expand Down
Loading

0 comments on commit fedff67

Please sign in to comment.