Skip to content

Commit

Permalink
Merge pull request #19 from brightway-lca/wiser_deliverables
Browse files Browse the repository at this point in the history
More #18 Fixes
  • Loading branch information
michaelweinold authored Oct 2, 2024
2 parents 58164da + 4d6a8fa commit c1fa9bd
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 52 deletions.
14 changes: 8 additions & 6 deletions app/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,13 @@ def nodes_dict_to_dataframe(nodes: dict) -> pd.DataFrame:
A dataframe with human-readable descriptions and emissions values of the nodes in the graph traversal.
"""
list_of_row_dicts = []
for i in range(0, len(nodes)):
current_node: Node = nodes[i]
for current_node in nodes.values():

scope_1: bool = False
if current_node.unique_id == 0:

if current_node.unique_id == -1:
continue
elif current_node.unique_id == 0:
scope_1 = True
else:
pass
Expand All @@ -101,16 +104,15 @@ def nodes_dict_to_dataframe(nodes: dict) -> pd.DataFrame:
return pd.DataFrame(list_of_row_dicts)


def edges_dict_to_dataframe(edges: dict) -> pd.DataFrame:
def edges_dict_to_dataframe(edges: list) -> pd.DataFrame:
"""
To be added...
"""
if len(edges) < 2:
return pd.DataFrame()
else:
list_of_row_dicts = []
for i in range(0, len(edges)-1):
current_edge: Edge = edges[i]
for current_edge in edges:
list_of_row_dicts.append(
{
'consumer_unique_id': current_edge.consumer_unique_id,
Expand Down
12 changes: 12 additions & 0 deletions dev/edit_graph.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import pandas as pd

# %%

data = {
'uid': [0, 1, 2, 3],
'description': ['cardboard', 'paper', 'wood', 'electricity'],
'production': [True, False, True, False],
'emissions_intensity': [1.5, 2.2, 0.7, 0.2],
}

df = pd.DataFrame(data)
9 changes: 6 additions & 3 deletions dev/trace_branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ def nodes_dict_to_dataframe(nodes: dict) -> pd.DataFrame:
A dataframe with human-readable descriptions and emissions values of the nodes in the graph traversal.
"""
list_of_row_dicts = []
for i in range(0, len(nodes)-1):
current_node: Node = nodes[i]
for current_node in nodes.values():

scope_1: bool = False
if current_node.unique_id == 0:

if current_node.unique_id == -1:
continue
elif current_node.unique_id == 0:
scope_1 = True
else:
pass
Expand Down
81 changes: 41 additions & 40 deletions pyodide/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyodide/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
panel==1.5.0 # https://pypi.org/project/panel/#history
panel==1.5.1 # https://pypi.org/project/panel/#history
plotly==5.24.0 # https://pypi.org/project/plotly/#history
bw2data==4.0.dev52 # https://pypi.org/project/bw2data/#history
bw2io==0.9.dev37 # https://pypi.org/project/bw2io/#history
Expand Down

0 comments on commit c1fa9bd

Please sign in to comment.