Skip to content

Commit

Permalink
Factor out dataframe column names
Browse files Browse the repository at this point in the history
  • Loading branch information
veghp committed Sep 30, 2024
1 parent e75e637 commit 8e338c6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions plateo/parsers/picklist_from_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,23 @@ def picklist_from_csv_file(
dataframe = pandas.read_csv(filename)

if source_plates == "auto":
source_plate_column = DF_COLUMNS["source_plate"]
source_plates = []
for name in dataframe["source_plate"].unique():
for name in dataframe[source_plate_column].unique():
nwells = infer_plate_size_from_wellnames(
dataframe[dataframe["source_plate"] == name]["source_well"]
dataframe[dataframe[source_plate_column] == name][
DF_COLUMNS["source_well"]
]
)
source_plate = get_plate_class(nwells)()
source_plate.name = name
source_plates += [source_plate]
if dest_plates == "auto":
dest_plate_column = DF_COLUMNS["dest_plate"]
dest_plates = []
for name in dataframe["dest_plate"].unique():
for name in dataframe[dest_plate_column].unique():
nwells = infer_plate_size_from_wellnames(
dataframe[dataframe["dest_plate"] == name]["dest_well"]
dataframe[dataframe[dest_plate_column] == name][DF_COLUMNS["dest_well"]]
)
dest_plate = get_plate_class(nwells)()
dest_plate.name = name
Expand Down

0 comments on commit 8e338c6

Please sign in to comment.