Skip to content

Commit

Permalink
feat: adds column tests, fix typos in col test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mukund Iyer committed Jan 18, 2022
1 parent 99b9ca3 commit d827fab
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/magmaviz/boxplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ def boxplot(df, x, y, facet=False):
"'df' should be of type 'pandas.core.frame.DataFrame', a pandas dataframe."
)

# checking if x is a column name in the dataframe
assert x in list(
df.columns
), "This column specified for 'x' does not exist in the dataframe."
# checking if y is a column name in the dataframe
assert y in list(
df.columns
), "This column specified for 'y' does not exist in the dataframe."

# creating titles
x_title = re.sub(r"[_.,-]", " ", x)

Expand Down

0 comments on commit d827fab

Please sign in to comment.