Пример #1
0
def test_striplog():
    """Test most of the things.
    """
    r1 = Component({'lithology': 'sand'})
    r2 = Component({'lithology': 'shale'})
    r3 = Component({'lithology': 'limestone'})

    # Bottom up: elevation order
    iv1 = Interval(120, 100, components=[r1])
    iv2 = Interval(150, 120, components=[r2])
    iv3 = Interval(180, 160, components=[r1, r2])
    iv4 = Interval(200, 180, components=[r3, r2])

    s1 = Striplog([iv1, iv2])
    s2 = Striplog([iv3, iv4])
    s = s1 + s2
    assert s.order == 'elevation'
    assert len(s) == 4
    assert s.start.z == 100
    assert s.stop.z == 200
    assert s.__repr__() is not ''
    assert s.__str__() is not ''

    s_rev = s.invert(copy=True)
    assert s_rev.order == 'depth'
    x = s.invert()
    assert x is None
    assert s.order == 'depth'
    assert s[0] == iv1
    assert s[0].top.z == 100

    # Top down: depth order
    iv1 = Interval(80, 120, components=[r1])
    iv2 = Interval(120, 150, components=[r2])
    iv3 = Interval(180, 200, components=[r1, r2])
    iv4 = Interval(200, 250, components=[r3, r2])

    s = Striplog([iv1, iv2, iv3, iv4])
    assert s.order == 'depth'
    assert len(s) == 4
    assert s.start.z == 80
    assert s.stop.z == 250
    assert s._Striplog__strict()

    l = [iv.thickness for iv in s]
    assert len(l) == 4

    s[2] = Interval(180, 190, components=[r1, r2])
    assert len(s.find_gaps()) == 2

    # Crop.
    x = s.crop((110, 210), copy=True)
    assert x.start.z == 110

    # To csv
    csv = x.to_csv(header=True)
    assert csv[:3] == 'Top'

    # Add.
    assert len(s + iv4) == 5
Пример #2
0
def test_striplog():
    """Test most of the things.
    """
    r1 = Component({'lithology': 'sand'})
    r2 = Component({'lithology': 'shale'})
    r3 = Component({'lithology': 'limestone'})

    # Bottom up: elevation order
    iv1 = Interval(120, 100, components=[r1])
    iv2 = Interval(150, 120, components=[r2])
    iv3 = Interval(180, 160, components=[r1, r2])
    iv4 = Interval(200, 180, components=[r3, r2])

    s1 = Striplog([iv1, iv2])
    s2 = Striplog([iv3, iv4])
    s = s1 + s2
    assert s.order == 'elevation'
    assert len(s) == 4
    assert s.start.z == 100
    assert s.stop.z == 200
    assert s.__repr__() is not ''
    assert s.__str__() is not ''

    s_rev = s.invert(copy=True)
    assert s_rev.order == 'depth'
    x = s.invert()
    assert x is None
    assert s.order == 'depth'
    assert s[0] == iv1
    assert s[0].top.z == 100

    # Top down: depth order
    iv1 = Interval(80, 120, components=[r1])
    iv2 = Interval(120, 150, components=[r2])
    iv3 = Interval(180, 200, components=[r1, r2])
    iv4 = Interval(200, 250, components=[r3, r2])

    s = Striplog([iv1, iv2, iv3, iv4])
    assert s.order == 'depth'
    assert len(s) == 4
    assert s.start.z == 80
    assert s.stop.z == 250

    l = [iv.thickness for iv in s]
    assert len(l) == 4

    s[2] = Interval(180, 190, components=[r1, r2])
    assert len(s.find_gaps()) == 2

    # Crop.
    x = s.crop((110, 210), copy=True)
    assert x.start.z == 110

    # To csv
    csv = x.to_csv(header=True)
    assert csv[:3] == 'Top'

    # Add.
    assert len(s + iv4) == 5
Пример #3
0
def test_striplog():

    r1 = Component({'lithology': 'sand'})
    r2 = Component({'lithology': 'shale'})
    r3 = Component({'lithology': 'limestone'})

    # Bottom up: elevation order
    iv1 = Interval(120, 100, components=[r1])
    iv2 = Interval(150, 120, components=[r2])
    iv3 = Interval(180, 160, components=[r1, r2])
    iv4 = Interval(200, 180, components=[r3, r2])

    s1 = Striplog([iv1, iv2])
    s2 = Striplog([iv3, iv4])
    s = s1 + s2
    assert s.order == 'elevation'
    assert len(s) == 4
    assert s.start == 100
    assert s.stop == 200
    assert s.__repr__() is not ''
    assert s.__str__() is not ''

    # Top down: depth order
    iv1 = Interval(80, 120, components=[r1])
    iv2 = Interval(120, 150, components=[r2])
    iv3 = Interval(180, 200, components=[r1, r2])
    iv4 = Interval(200, 250, components=[r3, r2])

    s = Striplog([iv1, iv2, iv3, iv4])
    assert s.order == 'depth'
    assert len(s) == 4
    assert s.start == 80
    assert s.stop == 250

    l = [iv.thickness for iv in s]
    assert len(l) == 4

    s[2] = Interval(180, 190, components=[r1, r2])
    assert len(s.find_gaps()) == 2

    assert s._Striplog__sort()  # Not used, should probably delete
Пример #4
0
def test_striplog():

    r1 = Component({'lithology': 'sand'})
    r2 = Component({'lithology': 'shale'})
    r3 = Component({'lithology': 'limestone'})

    # Bottom up: elevation order
    iv1 = Interval(120, 100, components=[r1])
    iv2 = Interval(150, 120, components=[r2])
    iv3 = Interval(180, 160, components=[r1, r2])
    iv4 = Interval(200, 180, components=[r3, r2])

    s1 = Striplog([iv1, iv2])
    s2 = Striplog([iv3, iv4])
    s = s1 + s2
    assert s.order == 'elevation'
    assert len(s) == 4
    assert s.start == 100
    assert s.stop == 200
    assert s.__repr__() is not ''
    assert s.__str__() is not ''

    # Top down: depth order
    iv1 = Interval(80, 120, components=[r1])
    iv2 = Interval(120, 150, components=[r2])
    iv3 = Interval(180, 200, components=[r1, r2])
    iv4 = Interval(200, 250, components=[r3, r2])

    s = Striplog([iv1, iv2, iv3, iv4])
    assert s.order == 'depth'
    assert len(s) == 4
    assert s.start == 80
    assert s.stop == 250

    l = [iv.thickness for iv in s]
    assert len(l) == 4

    s[2] = Interval(180, 190, components=[r1, r2])
    assert len(s.find_gaps()) == 2

    assert s._Striplog__sort()  # Not used, should probably delete
Пример #5
0
def test_striplog():
    r1 = Component({"lithology": "sand"})
    r2 = Component({"lithology": "shale"})
    r3 = Component({"lithology": "limestone"})

    # Bottom up: elevation order
    iv1 = Interval(120, 100, components=[r1])
    iv2 = Interval(150, 120, components=[r2])
    iv3 = Interval(180, 160, components=[r1, r2])
    iv4 = Interval(200, 180, components=[r3, r2])

    s1 = Striplog([iv1, iv2])
    s2 = Striplog([iv3, iv4])
    s = s1 + s2
    assert s.order == "elevation"
    assert len(s) == 4
    assert s.start == 100
    assert s.stop == 200
    assert s.__repr__() is not ""
    assert s.__str__() is not ""

    # Top down: depth order
    iv1 = Interval(80, 120, components=[r1])
    iv2 = Interval(120, 150, components=[r2])
    iv3 = Interval(180, 200, components=[r1, r2])
    iv4 = Interval(200, 250, components=[r3, r2])

    s = Striplog([iv1, iv2, iv3, iv4])
    assert s.order == "depth"
    assert len(s) == 4
    assert s.start == 80
    assert s.stop == 250

    l = [iv.thickness for iv in s]
    assert len(l) == 4

    s[2] = Interval(180, 190, components=[r1, r2])
    assert len(s.find_gaps()) == 2