Skip to content

Commit

Permalink
removing obsolete function
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanDietzMorris committed Feb 19, 2024
1 parent 7e5c208 commit 6013c12
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions Common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,40 +426,6 @@ def get_foodb_files(self, full_url: str, data_dir: str, data_file_name: str, fil
# return the list
return file_count, foodb_dir, name[0]

@staticmethod
def format_normalization_failures(data_set_name: str, node_norm_failures: list, edge_norm_failures: list):
"""
outputs the nodes/edges that failed normalization
:param data_set_name: the name of the data source that produced these results
:param node_norm_failures: set of node curies
:param edge_norm_failures: set of edge predicates
:return:
"""
the_logger = LoggingUtil.init_logging(f"ORION.Common.NormFailures.{data_set_name}", level=logging.INFO, line_format='medium', log_file_path=os.path.join(Path(__file__).parents[1], 'logs'))

# get the list into a dataframe group
df = pd.DataFrame(node_norm_failures, columns=['curie'])
df_node_grp = df.groupby('curie').size() \
.reset_index(name='count') \
.sort_values('count', ascending=False)

# iterate through the groups and create the edge records.
for row_index, row in df_node_grp.iterrows():
the_logger.info(f'{row["curie"]}\t{data_set_name}')
# self.logger.info(f'Failed node CURIE: {row["curie"]}, count: {row["count"]}')

# get the list into a dataframe group
df = pd.DataFrame(edge_norm_failures, columns=['curie'])
df_edge_grp = df.groupby('curie').size() \
.reset_index(name='count') \
.sort_values('count', ascending=False)

# iterate through the groups and create the edge records.
for row_index, row in df_edge_grp.iterrows():
the_logger.info(f'{row["curie"]}\t{data_set_name}')
# self.logger.info(f'Failed edge predicate: {row["curie"]}, count: {row["count"]}')

@staticmethod
def split_file(archive_file_path: str, output_dir: str, data_file_name: str, lines_per_file: int = 500000) -> list:
"""
Expand Down

0 comments on commit 6013c12

Please sign in to comment.