コード例 #1
0
ファイル: test_core.py プロジェクト: Swarchal/plate_generator
def test_column_plate():
    # 384
    plate_384 = plate_generator.column_plate(plate=384)
    assert plate_384.shape == SHAPE_384
    assert isinstance(plate_384.data, np.ndarray)
    # 1536
    plate_1536 = plate_generator.column_plate(plate=1536)
    assert plate_1536.shape == SHAPE_1536
    assert isinstance(plate_1536.data, np.ndarray)
コード例 #2
0
ファイル: test_core.py プロジェクト: Swarchal/plate_generator
def test_add_plates():
    plate_a = plate_generator.normal_plate()
    plate_b = plate_generator.column_plate()
    combined_plate = plate_a + plate_b
    assert isinstance(combined_plate, plate_generator.Plate)
    # do the same operation in numpy
    combined_array = plate_a.data + plate_b.data
    assert (combined_array == combined_plate.data).all()
    # try adding a scalar value
    add_one = plate_a + 1
    assert isinstance(add_one, plate_generator.Plate)
    assert isinstance(add_one.data, np.ndarray)
    # to the same operation in numpy
    add_one_array = plate_a.data + 1
    assert (add_one.data == add_one_array).all()
    # add multiple
    plate_c = plate_generator.column_plate()
    combined_three = plate_a + plate_b + plate_c
    assert isinstance(combined_three.data, np.ndarray)
    assert isinstance(combined_three, plate_generator.Plate)
コード例 #3
0
ファイル: test_core.py プロジェクト: Swarchal/plate_generator
def test_divide_plates():
    plate_a = plate_generator.normal_plate()
    plate_b = plate_generator.column_plate()
    div_plate = plate_a / plate_b
    assert isinstance(div_plate, plate_generator.Plate)
    # do the same operation in numpy
    div_array = plate_a.data / plate_b.data
    assert (div_array == div_plate.data).all()
    # try adding a scalar value
    div_two = plate_a / 2
    assert isinstance(div_two, plate_generator.Plate)
    assert isinstance(div_two.data, np.ndarray)
    # to the same operation in numpy
    div_two_array = plate_a.data / 2
    assert (div_two.data == div_two_array).all()
コード例 #4
0
ファイル: test_core.py プロジェクト: Swarchal/plate_generator
def test_subtract_plates():
    plate_a = plate_generator.normal_plate()
    plate_b = plate_generator.column_plate()
    subtracted_plate = plate_a - plate_b
    assert isinstance(subtracted_plate, plate_generator.Plate)
    # do the same operation in numpy
    subtracted_array = plate_a.data - plate_b.data
    assert (subtracted_array == subtracted_plate.data).all()
    # try adding a scalar value
    subtract_one = plate_a - 1
    assert isinstance(subtract_one, plate_generator.Plate)
    assert isinstance(subtract_one.data, np.ndarray)
    # to the same operation in numpy
    subtract_one_array = plate_a.data - 1
    assert (subtract_one.data == subtract_one_array).all()
コード例 #5
0
ファイル: test_core.py プロジェクト: Swarchal/plate_generator
def test_multiply_plates():
    plate_a = plate_generator.normal_plate()
    plate_b = plate_generator.column_plate()
    combined_plate = plate_a * plate_b
    assert isinstance(combined_plate, plate_generator.Plate)
    # do the same operation in numpy
    combined_array = plate_a.data * plate_b.data
    assert (combined_array == combined_plate.data).all()
    # try adding a scalar value
    mult_two = plate_a * 2
    assert isinstance(mult_two, plate_generator.Plate)
    assert isinstance(mult_two.data, np.ndarray)
    # to the same operation in numpy
    mult_two_array = plate_a.data * 2
    assert (mult_two.data == mult_two_array).all()