Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
hechth committed Jun 19, 2024
1 parent 9aa3e44 commit 0562236
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/rcx_tk/process_metadata_file.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pandas as pd
import os
import pandas as pd


def read_file(file_path):
"""Reads a file and returns a DataFrame based on the file extension."""
Expand Down Expand Up @@ -28,7 +29,7 @@ def process_metadata_file(file_path):
'Batch': 'batch',
'Analytical order': 'injectionOrder'
}

df = read_file(file_path)
df = df[list(columns_to_keep.keys())].rename(columns=columns_to_keep)
df['sampleName'] = df['sampleName'].str.replace(' ', '_')
Expand All @@ -40,7 +41,7 @@ def process_alkane_ri_file(file_path):
'Carbon number': 'carbon_number',
'RT (min)': 'rt'
}

df = read_file(file_path)
df.columns = df.columns.str.strip()
df = df.rename(columns=columns_to_keep)
Expand Down

0 comments on commit 0562236

Please sign in to comment.