Skip to content

Commit cfb3a6a

Browse files
committed
Plugins Updated
1 parent 52c2b88 commit cfb3a6a

6 files changed

Lines changed: 18 additions & 16 deletions

File tree

app.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from toggle_bars import toggle_bars
1313

1414
import tempfile, os, shutil
15+
import traceback
1516

1617
app = Flask(__name__)
1718

@@ -27,7 +28,7 @@ def Sankey_Evaluate():
2728

2829
########## REPLACE THIS SECTION WITH OWN RUN CODE #################
2930
#uses rdf types
30-
accepted_types = {'Component'}
31+
accepted_types = {'Component', 'ComponentDefinition'}
3132

3233
acceptable = rdf_type in accepted_types
3334

@@ -63,13 +64,11 @@ def Sankey_Run():
6364
#retrieve information about the poi
6465
self_df, display_id, title, role, count = input_data(top_level_url, instance_url)
6566

66-
#print("Find role name")
6767
#Find the role name in the ontology of the part of interest
6868
role_link = find_role_name(role, plural = False)
6969

7070
#create data for the sankey diagram and format it correctly
7171
df_sankey = sankey(url, top_level_url, title, instance_url)
72-
7372
sankey_title = "Parts Co-Located with "+ title + " (a "+role_link+")"
7473

7574
#create a temporary directory
@@ -90,7 +89,8 @@ def Sankey_Run():
9089

9190
return result
9291
except Exception as e:
93-
print(e)
92+
print(e, flush=True)
93+
print(traceback.format_exc(), flush=True)
9494
abort(400)
9595

9696
#flask run --host=0.0.0.0
@@ -106,7 +106,7 @@ def Bar_Evaluate():
106106

107107
########## REPLACE THIS SECTION WITH OWN RUN CODE #################
108108
#uses rdf types
109-
accepted_types = {'Component'}
109+
accepted_types = {'Component', 'ComponentDefinition'}
110110

111111
acceptable = rdf_type in accepted_types
112112

@@ -180,5 +180,6 @@ def Bar_Run():
180180

181181
return toggle_display
182182
except Exception as e:
183-
print(e)
183+
print(e, flush=True)
184+
print(traceback.format_exc(), flush=True)
184185
abort(400)

input_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import json
22
import requests
3-
from pandas.io.json import json_normalize
3+
from pandas import json_normalize
44

55
def input_data(uri, instance):
66
"""
@@ -10,7 +10,7 @@ def input_data(uri, instance):
1010
-------
1111
import json
1212
import requests
13-
from pandas.io.json import json_normalize
13+
from pandas import json_normalize
1414
Input_Query.txt
1515
1616
Parameters

most_used_bar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pandas as pd
22
import requests
33
import json
4-
from pandas.io.json import json_normalize
4+
from pandas import json_normalize
55
from uri_to_url import uri_to_url
66

77
def most_used_bar(uri, instance, display_id, title, role, count):

most_used_by_type_bar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pandas as pd
22
import requests
33
import json
4-
from pandas.io.json import json_normalize
4+
from pandas import json_normalize
55
from uri_to_url import uri_to_url
66

77
def most_used_by_type_bar(uri, instance, display_id, title, role, count):

requirements.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
bs4==0.0.1
2-
Flask==2.0.1
2+
Flask==2.2.5
33
jsonschema==3.0.1
4-
pandas==0.24.2
4+
pandas==2.2.3
55
plotly==3.9.0
66
requests==2.21.0
7-
8-
7+
Werkzeug==2.2.3
8+
waitress
9+
lxml

sankey.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import requests
22
import json
33
import pandas as pd
4-
from pandas.io.json import json_normalize
4+
from pandas import json_normalize
55
from uri_to_url import uri_to_url
66

77
def sankey(url, uri, title, instance):
@@ -16,7 +16,7 @@ def sankey(url, uri, title, instance):
1616
import requests
1717
import json
1818
import pandas as pd
19-
from pandas.io.json import json_normalize
19+
from pandas import json_normalize
2020
Preceding_Percent_Query.txt
2121
2222

0 commit comments

Comments
 (0)