Skip to content

Commit

Permalink
FIX GUI tip None
Browse files Browse the repository at this point in the history
  • Loading branch information
qPCR4vir committed Aug 20, 2019
1 parent 43a23ac commit ff287cb
Show file tree
Hide file tree
Showing 6 changed files with 565 additions and 14 deletions.
2 changes: 2 additions & 0 deletions EvoScriPy/GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ def __init__(self, protocol):

def set_firstTip(self, *args):
self.protocol.firstTip = self.firstTip_v.get()
if self.protocol.firstTip == "None":
self.protocol.firstTip = None

def set_WT_FN(self, *args):
self.protocol.worktable_template_filename = self.worktable_filename_v.get()
Expand Down
31 changes: 17 additions & 14 deletions EvoScriPy/labware.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,8 @@ def set_first_pos(self, labw_type_name=None, posstr=None):
labw = self.get_DITI_series().current
assert labw, "Failed to find first DITI position."

if posstr is None:
posstr = ""

pos = posstr.split('-')

Expand Down Expand Up @@ -983,25 +985,26 @@ def autoselect(self, offset=0, maxTips=1, replys=1): # OK make this "virtual".
self.selectOnly(range(offset, offset + maxTips))
return maxTips

def offset(self, row, col=1):
if isinstance(row, str):
assert col == 1, "Please, define the column only in the row string."
return self.offsetFromName(row)
def offset(self, row_pos, col=1):
assert row_pos is not None

if isinstance(row_pos, Well):
assert row_pos.labware is self, "This is a well from another labware."
return row_pos.offset

if isinstance(row, Well):
assert row.labware is self, "This is a well from another labware."
return row.offset
if isinstance(row_pos, str):
assert col == 1, "Please, define the column only in the row string."
return self.offsetFromName(row_pos)

if isinstance(row, Labware.Position):
col = row.col
row = row.row
if isinstance(row_pos, Labware.Position):
col = row_pos.col
row_pos = row_pos.row

if isinstance(row, int):
return row - 1 + (col - 1) * self.type.nRow
if isinstance(row_pos, int):
return row_pos - 1 + (col - 1) * self.type.nRow

assert len(row.replicas) == 1, "Failed to assume a Reagent with only one replica (aliquot)"
return self.offset(row)
assert len(row_pos.replicas) == 1, "Failed to assume a Reagent with only one replica (aliquot)"
return self.offset(row_pos, col)

# assert False, "Unknow row type"

Expand Down
Loading

0 comments on commit ff287cb

Please sign in to comment.