-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test convert_valuetable_to_volumetable()
- Loading branch information
Showing
3 changed files
with
78 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
,factor_1,factor_2,factor_3,complement,final_volume | ||
units,uL,uL,uL,WATER,3 | ||
unit_1,0,0,0,, | ||
unit_2,1,0,0,, | ||
unit_3,0,1,0,, | ||
unit_4,0,0,1,, | ||
unit_5,1,1,0,, | ||
unit_6,1,0,1,, | ||
unit_7,0,1,1,, | ||
unit_8,1,1,1,, | ||
unit_9,0,0,0,, | ||
unit_10,1,0,0,, | ||
unit_11,0,1,0,, | ||
unit_12,0,0,1,, | ||
unit_13,1,1,0,, | ||
unit_14,1,0,1,, | ||
unit_15,0,1,1,, | ||
unit_16,1,1,1,, | ||
unit_17,0,0,0,, | ||
unit_18,1,0,0,, | ||
unit_19,0,1,0,, | ||
unit_20,0,0,1,, | ||
unit_21,1,1,0,, | ||
unit_22,1,0,1,, | ||
unit_23,0,1,1,, | ||
unit_24,1,1,1,, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
,factor_1,factor_2,factor_3,complement | ||
unit_1,0.0,0.0,0.0,3.0 | ||
unit_2,1.0,0.0,0.0,2.0 | ||
unit_3,0.0,1.0,0.0,2.0 | ||
unit_4,0.0,0.0,1.0,2.0 | ||
unit_5,1.0,1.0,0.0,1.0 | ||
unit_6,1.0,0.0,1.0,1.0 | ||
unit_7,0.0,1.0,1.0,1.0 | ||
unit_8,1.0,1.0,1.0,0.0 | ||
unit_9,0.0,0.0,0.0,3.0 | ||
unit_10,1.0,0.0,0.0,2.0 | ||
unit_11,0.0,1.0,0.0,2.0 | ||
unit_12,0.0,0.0,1.0,2.0 | ||
unit_13,1.0,1.0,0.0,1.0 | ||
unit_14,1.0,0.0,1.0,1.0 | ||
unit_15,0.0,1.0,1.0,1.0 | ||
unit_16,1.0,1.0,1.0,0.0 | ||
unit_17,0.0,0.0,0.0,3.0 | ||
unit_18,1.0,0.0,0.0,2.0 | ||
unit_19,0.0,1.0,0.0,2.0 | ||
unit_20,0.0,0.0,1.0,2.0 | ||
unit_21,1.0,1.0,0.0,1.0 | ||
unit_22,1.0,0.0,1.0,1.0 | ||
unit_23,0.0,1.0,1.0,1.0 | ||
unit_24,1.0,1.0,1.0,0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,52 @@ | ||
import filecmp | ||
import os | ||
|
||
import pandas | ||
|
||
from plateo.applications.doe import ( | ||
import_valuetable_from_csv, | ||
convert_valuetable_to_volumetable, | ||
convert_volumetable_to_actiontable, | ||
import_volumetable_from_csv_file, | ||
) | ||
from plateo.parsers import plate_from_content_spreadsheet | ||
from plateo.containers import Plate96 | ||
|
||
valuetable_path = os.path.join("tests", "data", "applications", "valuetable.csv") | ||
volumetable_out_path = os.path.join( | ||
"tests", "data", "applications", "volumetable_out.csv" | ||
) | ||
|
||
volumetable_path = os.path.join("tests", "data", "applications", "volumetable.csv") | ||
source_plate_path = os.path.join("tests", "data", "applications", "Source_Plate.xlsx") | ||
|
||
|
||
def test_convert_valuetable_to_volumetable(tmpdir): | ||
valuetable = import_valuetable_from_csv(valuetable_path) | ||
volumetable = convert_valuetable_to_volumetable(valuetable) | ||
volumetable.to_csv( | ||
path_or_buf=os.path.join(tmpdir, "volumetable_out.csv"), | ||
sep=",", | ||
columns=None, | ||
header=True, | ||
index=True, | ||
) | ||
assert filecmp.cmp( | ||
os.path.join(volumetable_out_path), | ||
os.path.join(tmpdir, "volumetable_out.csv"), | ||
) | ||
|
||
|
||
def test_volumetable_from_csv_file(): | ||
assert type(import_volumetable_from_csv_file(volumetable_path)) == pandas.DataFrame | ||
assert type(import_volumetable_from_csv_file(volumetable_path)) is pandas.DataFrame | ||
|
||
|
||
def test_dataframe_from_volume_table(): | ||
def test_convert_volumetable_to_actiontable(): | ||
volumetable = import_volumetable_from_csv_file(volumetable_path) | ||
source_plate = plate_from_content_spreadsheet(source_plate_path) | ||
dest_plate = Plate96(name="dest") | ||
dataframe = convert_volumetable_to_actiontable( | ||
volumetable=volumetable, source_plate=source_plate, dest_plate=dest_plate | ||
) | ||
|
||
assert type(dataframe) == pandas.DataFrame | ||
assert type(dataframe) is pandas.DataFrame |