Skip to content

Commit

Permalink
fixing bug with biolink prefixes and ignored properties
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanDietzMorris committed Jan 22, 2025
1 parent 2304cb7 commit 6be0ab9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Common/kgx_file_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,19 +197,18 @@ def __convert_to_csv(input_file: str,
if property_ignore_list:
ignored_props_present = set()
for ignored_prop in property_ignore_list:
if headers.pop(ignored_prop, 'PROP_NOT_FOUND') != 'PROP_NOT_FOUND':
if properties.pop(ignored_prop, 'PROP_NOT_FOUND') != 'PROP_NOT_FOUND':
del headers[ignored_prop.removeprefix("biolink:")]
ignored_props_present.add(ignored_prop)
if not ignored_props_present:
property_ignore_list = None
else:
property_ignore_list = ignored_props_present
print(f'Properties that should be ignored were found, ignoring: {property_ignore_list}')

properties_that_are_lists = {prop for prop in headers if properties[prop] in {'LABEL',
'string[]',
'float[]',
'int[]'}}
properties_that_are_boolean = {prop for prop in headers if properties[prop] == 'boolean'}
properties_that_are_lists = {prop for prop, prop_type in properties.items()
if prop_type in {'LABEL', 'string[]', 'float[]', 'int[]'}}
properties_that_are_boolean = {prop for prop, prop_type in properties.items() if prop_type == 'boolean'}

with open(output_file, 'w', newline='') as output_file_handler:
csv_file_writer = csv.DictWriter(output_file_handler,
Expand Down

0 comments on commit 6be0ab9

Please sign in to comment.