Skip to content

Commit

Permalink
Merge pull request #20 from KristinaGomoryova/poetry
Browse files Browse the repository at this point in the history
Keywords field in pyproject.toml file updated
  • Loading branch information
hechth authored Jul 8, 2024
2 parents 0e8362f + dcae0b7 commit 50edef2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
16 changes: 9 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description = "This package adjusts and cleans the metadata file provided by a u
authors = ["Zargham Ahmad <[email protected]>" ]
license = "MIT"
readme = "README.md"
keywords = ["metadata", "alkanes", "metabolomics"]

[tool.poetry.dependencies]
python = "^3.11"
Expand Down Expand Up @@ -46,7 +47,7 @@ line-length = 120

[tool.ruff.lint]
# Enable Pyflakes `E` and `F` codes by default.
select = [
lint.select = [
"F", # Pyflakes
"E", # pycodestyle (error)
"W", # pycodestyle (warning)
Expand All @@ -60,7 +61,7 @@ select = [
# "PLW", # Warning

]
ignore = [
lint.ignore = [
'D100', # Missing module docstring
'D104', # Missing public package docstring
# The following list excludes rules irrelevant to the Google style
Expand All @@ -79,8 +80,8 @@ ignore = [
]

# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["A", "B", "C", "D", "E", "F", "I"]
unfixable = []
lint.fixable = ["A", "B", "C", "D", "E", "F", "I"]
lint.unfixable = []

exclude = [
".bzr",
Expand All @@ -105,11 +106,12 @@ exclude = [
".venv",
"scripts",
]
per-file-ignores = {}
lint.per-file-ignores = {}


# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
lint.line-length = 120

[tool.ruff.lint.isort]
known-first-party = ["rcx_tk"]
Expand All @@ -126,4 +128,4 @@ filename = "pyproject.toml"
filename = "CITATION.cff"

[[tool.bumpversion.files]]
filename = "docs/conf.py"
filename = "docs/conf.py"
12 changes: 6 additions & 6 deletions src/rcx_tk/process_metadata_file.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
import pandas as pd


def read_file(file_path: str) -> pd.DataFrame:
"""Imports the metadata file to pandas dataframe.
Expand All @@ -15,6 +14,7 @@ def read_file(file_path: str) -> pd.DataFrame:
pd.DataFrame: Dataframe containing the metadata.
"""


file_extension = os.path.splitext(file_path)[1].lower()
if file_extension == '.csv':
return pd.read_csv(file_path, encoding='UTF-8')
Expand Down Expand Up @@ -48,11 +48,11 @@ def process_metadata_file(file_path: str, out_path: str) -> None:
out_path (str): A path where processed metadata dataframe is exported.
"""
columns_to_keep = {
'File name': 'sampleName',
'Type': 'sampleType',
'Class ID': 'class',
'Batch': 'batch',
'Analytical order': 'injectionOrder'
"File name": "sampleName",
"Type": "sampleType",
"Class ID": "class",
"Batch": "batch",
"Analytical order": "injectionOrder",
}

df = read_file(file_path)
Expand Down

0 comments on commit 50edef2

Please sign in to comment.