Skip to content

Commit

Permalink
fix epp.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kedhammar committed Nov 30, 2023
1 parent 12631be commit 45eb8b0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scilifelab_epps/epp.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ class NotUniqueError(ValueError):
pass


def unique_check(l, msg):
def unique_check(to_check, msg):
"Check that l is of length 1, otherwise raise error, with msg appended"
if len(l) == 0:
if len(to_check) == 0:
raise EmptyError("No item found for {0}".format(msg))
elif len(l) != 1:
elif len(to_check) != 1:
raise NotUniqueError("Multiple items found for {0}".format(msg))


Expand Down Expand Up @@ -295,7 +295,7 @@ def format_file(
error_message = ""
duplicated_lines = []
exeptions = ["Sample", "Fail", ""]
if type(first_header) is not list:
if not isinstance(first_header, list):
if first_header:
first_header = [first_header]
else:
Expand Down Expand Up @@ -441,9 +441,9 @@ def get_well_number(art: Artifact) -> int:

# Ensure container well names match classical convention
assert (
art.container.type.y_dimension["is_alpha"] == True
art.container.type.y_dimension["is_alpha"] is True
and art.container.type.y_dimension["offset"] == 0
and art.container.type.x_dimension["is_alpha"] == False
and art.container.type.x_dimension["is_alpha"] is False
and art.container.type.x_dimension["offset"] == 1
), "Can't convert well name --> well number for invalid container"

Expand All @@ -453,8 +453,8 @@ def get_well_number(art: Artifact) -> int:
# Get simple dict translating letters to numbers
letter2num = {}
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i, l in zip(range(1, len(alphabet) + 1), alphabet):
letter2num[l] = i
for i, letter in zip(range(1, len(alphabet) + 1), alphabet):
letter2num[letter] = i

well_name = art.location[1]
row_letter, col_num = well_name.split(":")
Expand Down

0 comments on commit 45eb8b0

Please sign in to comment.