Skip to content

Commit

Permalink
Merge pull request #148 from ahjulstad/fix-deprecation-warning-tests
Browse files Browse the repository at this point in the history
Round indexes to lowest integer in indexing test
  • Loading branch information
kinverarity1 committed Jul 3, 2017
2 parents f4647e0 + 08a5170 commit 99f67f8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_enhancements.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import numpy
import pytest
import math

from lasio import las, read, exceptions

Expand Down Expand Up @@ -46,17 +47,18 @@ def test_df_indexing():
l = read(egfn("6038187_v1.2.las"))
metres = 9.05
spacing = l.well["STEP"].value
calc_index = (metres / spacing) - (l.well["STRT"].value / spacing)
calc_index = math.floor((metres / spacing) - (l.well["STRT"].value / spacing))
calc_index = int(calc_index)
assert l["GAMN"][calc_index] == l.df()["GAMN"][metres]


# TODO: make above test in reverse-ordered LAS (e.g. STRT > STOP)

def test_df_reverse():
l = read(egfn("sample_rev.las"))
metres = 1667
spacing = l.well["STEP"].value
calc_index = (metres / spacing) - (l.well["STRT"].value / spacing)
calc_index = math.floor((metres // spacing) - (l.well["STRT"].value // spacing))
calc_index = int(calc_index)
assert l["DT"][calc_index] == l.df()["DT"][metres]

Expand Down

0 comments on commit 99f67f8

Please sign in to comment.