Skip to content

Commit

Permalink
#321 get rid of nodes dictionary that doesn't exist and refactor it i…
Browse files Browse the repository at this point in the history
…nto other for loop
  • Loading branch information
ecwood committed Jul 20, 2023
1 parent 9ea83b5 commit c3c8ea3
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions report_stats_on_json_kg.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,18 +207,15 @@ def count_orphan_nodes(nodes: list, edges: list):

build_info = dict()

for n in nodes: # search for build info node starting at end
if n["id"] == kg2_util.CURIE_PREFIX_RTX + ':' + 'KG2': # should be the first node accessed
number_of_nodes = 0
for node in kg2_util.read_json_lines(input_nodes_file):
number_of_nodes += 1
if n["id"] == kg2_util.CURIE_PREFIX_RTX + ':' + 'KG2':
build_info = n
break

if len(build_info) == 0:
print("WARNING: 'build' property is missing from the input JSON.", file=sys.stderr)

number_of_nodes = 0
for node in kg2_util.read_json_lines(input_nodes_file):
number_of_nodes += 1

number_of_edges = 0
for edge in kg2_util.read_json_lines(input_edges_file):
number_of_edges += 1
Expand Down

0 comments on commit c3c8ea3

Please sign in to comment.