def test_data_attr(): las = lasio.LASFile() las.append_curve('TEST1', data=[1, 2, 3]) las.append_curve_item(lasio.CurveItem('TEST2', data=[4, 5, 6])) las.append_curve('TEST3', data=[7, 8, 9]) logger.debug('las.data = {}'.format(las.data)) # the .all() method assumes these are numpy ndarrays; that should be the case. assert (las.data == np.asarray([[1, 4, 7], [2, 5, 8], [3, 6, 9]])).all()
def test_replace_curve(): las = lasio.examples.open("sample.las") las["NPHI"] = lasio.CurveItem("NPHI", "%", "Porosity", data=(las["NPHI"] * 100)) assert las.keys() == [ "DEPT", "DT", "RHOB", "NPHI", "SFLU", "SFLA", "ILM", "ILD" ] assert (las["NPHI"] == [45, 45, 45]).all()
def test_append_curve_and_item(): las = lasio.LASFile() data = [1, 2, 3] las.append_curve('TEST1', data=data) las.append_curve_item(lasio.CurveItem('TEST2', data=data)) assert (las['TEST1'] == las['TEST2']).all()
def test_append_curve_and_item(): las = lasio.LASFile() data = [1, 2, 3] las.append_curve("TEST1", data=data) las.append_curve_item(lasio.CurveItem("TEST2", data=data)) assert (las["TEST1"] == las["TEST2"]).all()