def test_log_pass_write_XML(): log_pass = _log_pass() ostream = io.StringIO() xml_stream = XmlWrite.XmlStream(ostream) iflr_map = { RepCode.ObjectName(O=11, C=0, I=b'0B'): [], } TotalDepth.RP66V1.IndexXML.log_pass_to_XML(log_pass, iflr_map, xml_stream) # print(ostream.getvalue()) expected = """ <LogPass count="1"> <FrameArray C="0" I="0B" O="11" description="" x_axis="DEPT" x_units="0.1 in"> <Channels count="9"> <Channel C="0" I="DEPT" O="11" count="1" dimensions="1" long_name="MWD Tool Measurement Depth" rep_code="2" units="0.1 in"/> <Channel C="0" I="INC" O="11" count="1" dimensions="1" long_name="Inclination" rep_code="2" units="deg"/> <Channel C="0" I="AZI" O="11" count="1" dimensions="1" long_name="Azimuth" rep_code="2" units="deg"/> <Channel C="0" I="MTTVD" O="11" count="1" dimensions="1" long_name="MWD Tool Measurement TVD" rep_code="2" units="m"/> <Channel C="0" I="SECT" O="11" count="1" dimensions="1" long_name="Section" rep_code="2" units="m"/> <Channel C="0" I="RCN" O="11" count="1" dimensions="1" long_name="Rectangular Co-ordinates North" rep_code="2" units="m"/> <Channel C="0" I="RCE" O="11" count="1" dimensions="1" long_name="Rectangular Co-ordinates East" rep_code="2" units="m"/> <Channel C="0" I="DLSEV" O="11" count="1" dimensions="1" long_name="Dog-leg Severity" rep_code="2" units="deg/30m"/> <Channel C="0" I="TLTS" O="11" count="1" dimensions="1" long_name="Tool Temperature Static" rep_code="2" units="degC"/> </Channels> <IFLR count="0"> <FrameNumbers count="0" rle_len="0"/> <LRSH count="0" rle_len="0"/> <Xaxis count="0" rle_len="0"/> </IFLR> </FrameArray> </LogPass>""" assert ostream.getvalue() == expected
def test_Object(eflr_data: DataForEFLR): eflr_data.rewind() template = EFLR.Template() template.read(eflr_data.template) obj = EFLR.Object(eflr_data.object, template) assert obj.name == RepCode.ObjectName(O=0, C=0, I=b'TIME') assert eflr_data.object.remain == 1 # Object byte terminates template
def test_logical_index_logical_file_iflr_position_map(): fobj = io.BytesIO(test_data.BASIC_FILE) with LogicalFile.LogicalIndex(fobj) as logical_index: assert len(logical_index) == 1 logical_file = logical_index.logical_files[0] # pprint.pprint(logical_file.iflr_position_map) expected_key = RepCode.ObjectName(O=2, C=0, I=b'50') assert list(logical_file.iflr_position_map.keys()) == [expected_key]
def test_log_pass_frame_channels_from_RP66V1_file(): log_pass = _log_pass() frame_array = log_pass[FRAME_ARRAY_IDENT] assert len(frame_array) == 9 # print(list(frame_array.keys())) expected = [ RepCode.ObjectName(O=11, C=0, I=b'DEPT'), RepCode.ObjectName(O=11, C=0, I=b'INC'), RepCode.ObjectName(O=11, C=0, I=b'AZI'), RepCode.ObjectName(O=11, C=0, I=b'MTTVD'), RepCode.ObjectName(O=11, C=0, I=b'SECT'), RepCode.ObjectName(O=11, C=0, I=b'RCN'), RepCode.ObjectName(O=11, C=0, I=b'RCE'), RepCode.ObjectName(O=11, C=0, I=b'DLSEV'), RepCode.ObjectName(O=11, C=0, I=b'TLTS'), ] assert list(frame_array.keys()) == expected
def test_iflr_ctor_zero_not_empty(): ld = File.LogicalData(IFLR_ZERO_NOT_EMPTY) iflr = IFLR.IndirectlyFormattedLogicalRecord(1, ld) assert iflr.lr_type == 1 assert iflr.object_name == RepCode.ObjectName(O=11, C=0, I=b'0B') assert iflr.frame_number == 0 assert iflr.preamble_length == 6 assert iflr.remain == 36 assert iflr.remain == ld.remain
def test_iflr_ctor(frame_number, by): ld = File.LogicalData(by) iflr = IFLR.IndirectlyFormattedLogicalRecord(1, ld) assert iflr.lr_type == 1 assert iflr.object_name == RepCode.ObjectName(O=11, C=0, I=b'0B') assert iflr.frame_number == frame_number assert iflr.preamble_length == 6 assert iflr.remain == 36 assert iflr.remain == ld.remain
def test_ObjectName_ctor_lt_false(): object_name = RepCode.ObjectName(1, 2, b'') with pytest.raises(TypeError) as err: object_name < 1 assert err.value.args[ 0] == "'<' not supported between instances of 'ObjectName' and 'int'" with pytest.raises(TypeError) as err: 1 < object_name assert err.value.args[ 0] == "'<' not supported between instances of 'int' and 'ObjectName'"
def test_frame_channel_numpy_indexes(dimensions, frame_number, expected): channel = LogPass.FrameChannel( ident=RepCode.ObjectName(O=11, C=0, I=b'DEPT'), long_name=b'Depth of measurement', rep_code=2, units=b'm', dimensions=dimensions, ) # print(channel.numpy_indexes(frame_number)) assert list(channel.numpy_indexes(frame_number)) == expected
def test_read_iflr_partial(): log_pass = _log_pass() frame_array: LogPass.FrameArray = log_pass[FRAME_ARRAY_IDENT] channels = { RepCode.ObjectName(O=11, C=0, I=b'DEPT'), RepCode.ObjectName(O=11, C=0, I=b'INC'), RepCode.ObjectName(O=11, C=0, I=b'SECT'), } frame_array.init_arrays_partial(len(IFLR_BYTES), channels) for f, by in enumerate(IFLR_BYTES): iflr, logical_data = _iflr_and_logical_data_from_bytes(by) frame_array.read_partial(logical_data, f, channels) assert str(frame_array.channels[0].array) == """[[ 75197.] [154724.] [234606.] [311024.] [381102.] [386839.] [428193.] [447720.]]""" assert str(frame_array.channels[1].array) == """[[0.50002027] [0.50002027] [0.7500017 ] [0.50002027] [0.99998325] [0.9699998 ] [0.9699998 ] [0.69999975]]""" assert str(frame_array.channels[2].array) == """[]""" assert str(frame_array.channels[3].array) == """[]""" assert str(frame_array.channels[4].array) == """[[0.833423] [2.596255] [4.809544] [6.92684 ] [9.256786] [9.268364] [7.632412] [6.981416]]""" assert str(frame_array.channels[5].array) == """[]""" assert str(frame_array.channels[6].array) == """[]""" assert str(frame_array.channels[7].array) == """[]""" assert str(frame_array.channels[8].array) == """[]"""
def test_eflr_channel_obnames(): ld = File.LogicalData(BYTES_CHANNEL) channels = EFLR.ExplicitlyFormattedLogicalRecord( Types.EFLR_PUBLIC_SET_TYPE_TO_CODE_MAP[b'CHANNEL'], ld) channel_obnames = [obj.name for obj in channels.objects] # print(channel_obnames) assert channel_obnames == [ RepCode.ObjectName(O=11, C=0, I=b'DEPT'), RepCode.ObjectName(O=11, C=0, I=b'INC'), RepCode.ObjectName(O=11, C=0, I=b'AZI'), RepCode.ObjectName(O=11, C=0, I=b'MTTVD'), RepCode.ObjectName(O=11, C=0, I=b'SECT'), RepCode.ObjectName(O=11, C=0, I=b'RCN'), RepCode.ObjectName(O=11, C=0, I=b'RCE'), RepCode.ObjectName(O=11, C=0, I=b'DLSEV'), RepCode.ObjectName(O=11, C=0, I=b'TLTS'), ]
def test_eflr_frame_channels(): ld = File.LogicalData(BYTES_FRAME) frame = EFLR.ExplicitlyFormattedLogicalRecord( Types.EFLR_PUBLIC_SET_TYPE_TO_CODE_MAP[b'FRAME'], ld) obj = frame[0] channels = obj[b'CHANNELS'].value assert len(channels) == 9 assert channels == [ RepCode.ObjectName(O=11, C=0, I=b'DEPT'), RepCode.ObjectName(O=11, C=0, I=b'INC'), RepCode.ObjectName(O=11, C=0, I=b'AZI'), RepCode.ObjectName(O=11, C=0, I=b'MTTVD'), RepCode.ObjectName(O=11, C=0, I=b'SECT'), RepCode.ObjectName(O=11, C=0, I=b'RCN'), RepCode.ObjectName(O=11, C=0, I=b'RCE'), RepCode.ObjectName(O=11, C=0, I=b'DLSEV'), RepCode.ObjectName(O=11, C=0, I=b'TLTS') ]
def test_logical_index_logical_file_iflr_position_map_x_axis_summary(): fobj = io.BytesIO(test_data.BASIC_FILE) with LogicalFile.LogicalIndex(fobj) as logical_index: assert len(logical_index) == 1 logical_file = logical_index.logical_files[0] # pprint.pprint(logical_file.iflr_position_map) expected_key = RepCode.ObjectName(O=2, C=0, I=b'50') assert list(logical_file.iflr_position_map.keys()) == [expected_key] x_axis = logical_file.iflr_position_map[expected_key] assert len(x_axis) == 649 assert x_axis.summary.min == 2889.4 assert x_axis.summary.max == 2954.199999999941 assert x_axis.summary.count == 649
def test_logical_index_logical_file_iflr_position_map_x_axis_summary_spacing_counts( ): fobj = io.BytesIO(test_data.BASIC_FILE) with LogicalFile.LogicalIndex(fobj) as logical_index: assert len(logical_index) == 1 logical_file = logical_index.logical_files[0] # pprint.pprint(logical_file.iflr_position_map) expected_key = RepCode.ObjectName(O=2, C=0, I=b'50') assert list(logical_file.iflr_position_map.keys()) == [expected_key] x_axis = logical_file.iflr_position_map[expected_key] assert x_axis.summary.spacing.counts.norm == 648 assert x_axis.summary.spacing.counts.dupe == 0 assert x_axis.summary.spacing.counts.skip == 0 assert x_axis.summary.spacing.counts.back == 0
def test_logical_index_logical_file_iflr_position_map_x_axis_summary_spacing(): fobj = io.BytesIO(test_data.BASIC_FILE) with LogicalFile.LogicalIndex(fobj) as logical_index: assert len(logical_index) == 1 logical_file = logical_index.logical_files[0] # pprint.pprint(logical_file.iflr_position_map) expected_key = RepCode.ObjectName(O=2, C=0, I=b'50') assert list(logical_file.iflr_position_map.keys()) == [expected_key] x_axis = logical_file.iflr_position_map[expected_key] assert x_axis.summary.spacing.min == 0.09999999999990905 assert x_axis.summary.spacing.max == 0.09999999999990905 assert x_axis.summary.spacing.mean == 0.09999999999990905 assert x_axis.summary.spacing.median == 0.09999999999990905 assert x_axis.summary.spacing.std == 0.0
def test_example_iflr_process(): log_pass: LogPass.LogPass = _create_log_pass() # ObjectName(O=11, C=0, I=b'0B') frame_array: LogPass.FrameArray = log_pass[RepCode.ObjectName( 11, 0, b'0B')] frame_array.init_arrays(len(BYTES_IFLR)) # print() for frame_number, by in enumerate(BYTES_IFLR): ld = File.LogicalData(by) _iflr = IFLR.IndirectlyFormattedLogicalRecord(0, ld) # frame_array.read_x_axis(ld, frame_number=0) frame_array.read(ld, frame_number=frame_number) # print(frame_array) # print() expected = [ # X axis np.array([ [0.], [75197.], [154724.], [234606.], [311024.], [381102.], [386839.], [428193.], [447720.], [466339.], [489547.], [500559.], [523772.], [538638.], [542417.], [550409.], ]), np.array([ [0.], [0.50002027], [0.50002027], [0.7500017], [0.50002027], [0.99998325], [0.9699998], [0.9699998], [0.69999975], [1.0600001], [0.9699998], [0.8800001], [0.78999996], [1.7599998], [2.2000003], [2.9], ], ), np.array([ [0.], [0.], [0.], [0.], [0.], [0.], [200.44], [205.45], [206.18], [208.69], [202.7], [200.93], [255.77002], [243.87], [241.15], [240.7], ]), np.array([ [0.], [190.99757], [392.98987], [595.8777], [789.96594], [967.95013], [982.51935], [1087.5443], [1137.139], [1184.4233], [1243.3641], [1271.3306], [1330.2852], [1368.0354], [1377.6296], [1397.9094], ]), np.array([ [0.], [0.833423], [2.596255], [4.809544], [6.92684], [9.256786], [9.268364], [7.632412], [6.981416], [6.338459], [5.399805], [4.980779], [4.457969], [4.138596], [3.98476], [3.54544], ]), np.array([ [0.], [0.833423], [2.596255], [4.809544], [6.92684], [9.256786], [9.268364], [7.632412], [6.981416], [6.338459], [5.399805], [4.980779], [4.457969], [4.138596], [3.98476], [3.54544], ]), np.array([ [0.], [0.], [0.], [0.], [0.], [0.], [-0.043073], [-0.735641], [-1.049728], [-1.387169], [-1.841496], [-2.009587], [-2.565323], [-3.338264], [-3.632012], [-4.421124], ]), np.array([ [-9.9925000e+02], [7.9068176e-02], [0.0000000e+00], [3.7815217e-02], [3.7815217e-02], [8.4224798e-02], [3.9912241e+00], [2.4064228e-02], [1.6329297e-01], [2.3032904e-01], [7.0473805e-02], [1.0141353e-01], [3.9362201e-01], [7.9411954e-01], [1.4060384e+00], [1.0347618e+00], ]), np.array([ [-999.25], [-999.25], [-999.25], [-999.25], [-999.25], [-999.25], [50.3937], [56.4173], [58.4252], [58.4252], [62.4409], [62.4409], [62.4409], [62.4409], [62.4409], [58.4252], ]), ] for c, channel in enumerate(frame_array.channels): # print(channel.array) # np.testing.assert_array_almost_equal(channel.array, expected[c]) assert str(channel.array) == str(expected[c])
(LogicalData(b'\xff\xff\xff\xff'), 2**30 - 1), )) def test_ORIGIN(ld, expected): result = RepCode.ORIGIN(ld) assert result == expected assert ld.remain == 0 @pytest.mark.parametrize('ld, expected', UVARI_len_EXAMPLES) def test_ORIGIN_len(ld, expected): result = RepCode.ORIGIN_len(ld.bytes, 0) assert result == expected @pytest.mark.parametrize('args, expected', (((1, 2, b''), RepCode.ObjectName(1, 2, b'')), )) def test_ObjectName_ctor_eq(args, expected): object_name = RepCode.ObjectName(*args) assert object_name == expected def test_ObjectName_ctor_eq_false(): object_name = RepCode.ObjectName(1, 2, b'') assert not object_name == 1 assert not 1 == object_name def test_ObjectName_ctor_lt_false(): object_name = RepCode.ObjectName(1, 2, b'') with pytest.raises(TypeError) as err: object_name < 1
def test_ExplicitlyFormattedLogicalRecord_objects(ld): ld.rewind() eflr = EFLR.ExplicitlyFormattedLogicalRecord(3, ld) assert len(eflr.template) == 5 assert len(eflr.objects) == 3 ## Object #1 obj_index: int = 0 assert eflr.objects[0].name == RepCode.ObjectName(0, 0, b'TIME') assert len(eflr.objects[0].attrs) == len(eflr.template) # Attribute 0 attr_index = 0 assert eflr.objects[obj_index].attrs[attr_index].label == b'LONG-NAME' assert eflr.objects[obj_index].attrs[attr_index].count == 1 assert eflr.objects[obj_index].attrs[ attr_index].rep_code == RepCode.REP_CODE_STR_TO_INT['OBNAME'] assert eflr.objects[obj_index].attrs[attr_index].units == b'' assert eflr.objects[obj_index].attrs[attr_index].value == [ RepCode.ObjectName(0, 0, b'1') ] # Attribute 1 attr_index = 1 assert eflr.objects[obj_index].attrs[attr_index].label == b'ELEMENT-LIMIT' assert eflr.objects[obj_index].attrs[attr_index].count == 1 assert eflr.objects[obj_index].attrs[ attr_index].rep_code == RepCode.REP_CODE_STR_TO_INT['UVARI'] assert eflr.objects[obj_index].attrs[attr_index].units == b'' assert eflr.objects[obj_index].attrs[attr_index].value == [1] # Attribute 2 attr_index = 2 assert eflr.objects[obj_index].attrs[ attr_index].label == b'REPRESENTATION-CODE' assert eflr.objects[obj_index].attrs[attr_index].count == 1 assert eflr.objects[obj_index].attrs[ attr_index].rep_code == RepCode.REP_CODE_STR_TO_INT['USHORT'] assert eflr.objects[obj_index].attrs[attr_index].units == b'' assert eflr.objects[obj_index].attrs[attr_index].value == [ RepCode.REP_CODE_STR_TO_INT['FSINGL'] ] # Attribute 3 attr_index = 3 assert eflr.objects[obj_index].attrs[attr_index].label == b'UNITS' assert eflr.objects[obj_index].attrs[attr_index].count == 1 assert eflr.objects[obj_index].attrs[ attr_index].rep_code == RepCode.REP_CODE_STR_TO_INT['IDENT'] assert eflr.objects[obj_index].attrs[attr_index].units == b'' assert eflr.objects[obj_index].attrs[attr_index].value == [b'S'] # Attribute 4 attr_index = 4 assert eflr.objects[obj_index].attrs[attr_index].label == b'DIMENSION' assert eflr.objects[obj_index].attrs[attr_index].count == 1 assert eflr.objects[obj_index].attrs[ attr_index].rep_code == RepCode.REP_CODE_STR_TO_INT['UVARI'] assert eflr.objects[obj_index].attrs[attr_index].units == b'' assert eflr.objects[obj_index].attrs[attr_index].value == [1] ## Object #2 obj_index: int = 1 assert eflr.objects[0].name == RepCode.ObjectName(0, 0, b'TIME') assert len(eflr.objects[0].attrs) == len(eflr.template) # Attribute 0 attr_index = 0 assert eflr.objects[obj_index].attrs[attr_index].label == b'LONG-NAME' assert eflr.objects[obj_index].attrs[attr_index].count == 1 assert eflr.objects[obj_index].attrs[ attr_index].rep_code == RepCode.REP_CODE_STR_TO_INT['OBNAME'] assert eflr.objects[obj_index].attrs[attr_index].units == b'' assert eflr.objects[obj_index].attrs[attr_index].value == [ RepCode.ObjectName(0, 0, b'2') ] # Attribute 1 attr_index = 1 assert eflr.objects[obj_index].attrs[attr_index].label == b'ELEMENT-LIMIT' assert eflr.objects[obj_index].attrs[attr_index].count == 1 assert eflr.objects[obj_index].attrs[ attr_index].rep_code == RepCode.REP_CODE_STR_TO_INT['UVARI'] assert eflr.objects[obj_index].attrs[attr_index].units == b'' assert eflr.objects[obj_index].attrs[attr_index].value == [1] # Attribute 2 attr_index = 2 assert eflr.objects[obj_index].attrs[ attr_index].label == b'REPRESENTATION-CODE' assert eflr.objects[obj_index].attrs[attr_index].count == 1 assert eflr.objects[obj_index].attrs[ attr_index].rep_code == RepCode.REP_CODE_STR_TO_INT['USHORT'] assert eflr.objects[obj_index].attrs[attr_index].units == b'' assert eflr.objects[obj_index].attrs[attr_index].value == [ RepCode.REP_CODE_STR_TO_INT['FDOUBL'] ] # Attribute 3 attr_index = 3 assert eflr.objects[obj_index].attrs[attr_index].label == b'UNITS' assert eflr.objects[obj_index].attrs[attr_index].count == 1 assert eflr.objects[obj_index].attrs[ attr_index].rep_code == RepCode.REP_CODE_STR_TO_INT['IDENT'] assert eflr.objects[obj_index].attrs[attr_index].units == b'' assert eflr.objects[obj_index].attrs[attr_index].value == [b'PSI'] # Attribute 4 attr_index = 4 assert eflr.objects[obj_index].attrs[attr_index].label == b'DIMENSION' assert eflr.objects[obj_index].attrs[attr_index].count == 1 assert eflr.objects[obj_index].attrs[ attr_index].rep_code == RepCode.REP_CODE_STR_TO_INT['UVARI'] assert eflr.objects[obj_index].attrs[attr_index].units == b'' assert eflr.objects[obj_index].attrs[attr_index].value == [1] ## Object #3 obj_index: int = 2 assert eflr.objects[0].name == RepCode.ObjectName(0, 0, b'TIME') assert len(eflr.objects[0].attrs) == len(eflr.template) # Attribute 0 attr_index = 0 assert eflr.objects[obj_index].attrs[attr_index].label == b'LONG-NAME' assert eflr.objects[obj_index].attrs[attr_index].count == 1 assert eflr.objects[obj_index].attrs[ attr_index].rep_code == RepCode.REP_CODE_STR_TO_INT['OBNAME'] assert eflr.objects[obj_index].attrs[attr_index].units == b'' assert eflr.objects[obj_index].attrs[attr_index].value == [ RepCode.ObjectName(0, 0, b'3') ] # Attribute 1 attr_index = 1 assert eflr.objects[obj_index].attrs[attr_index].label == b'ELEMENT-LIMIT' assert eflr.objects[obj_index].attrs[attr_index].count == 2 assert eflr.objects[obj_index].attrs[ attr_index].rep_code == RepCode.REP_CODE_STR_TO_INT['UVARI'] assert eflr.objects[obj_index].attrs[attr_index].units == b'' assert eflr.objects[obj_index].attrs[attr_index].value == [8, 20] # Attribute 2 attr_index = 2 assert eflr.objects[obj_index].attrs[ attr_index].label == b'REPRESENTATION-CODE' assert eflr.objects[obj_index].attrs[attr_index].count == 1 assert eflr.objects[obj_index].attrs[ attr_index].rep_code == RepCode.REP_CODE_STR_TO_INT['USHORT'] assert eflr.objects[obj_index].attrs[attr_index].units == b'' # See above for: NOTE: [RP66V1 Error] assert eflr.objects[obj_index].attrs[attr_index].value == [ RepCode.REP_CODE_STR_TO_INT['SNORM'] ] # Attribute 3 attr_index = 3 assert eflr.objects[obj_index].attrs[attr_index].label == b'UNITS' assert eflr.objects[obj_index].attrs[attr_index].count == 1 assert eflr.objects[obj_index].attrs[ attr_index].rep_code == RepCode.REP_CODE_STR_TO_INT['IDENT'] assert eflr.objects[obj_index].attrs[attr_index].units == b'' assert eflr.objects[obj_index].attrs[attr_index].value is None # Attribute 4 attr_index = 4 assert eflr.objects[obj_index].attrs[attr_index].label == b'DIMENSION' assert eflr.objects[obj_index].attrs[attr_index].count == 2 assert eflr.objects[obj_index].attrs[ attr_index].rep_code == RepCode.REP_CODE_STR_TO_INT['UVARI'] assert eflr.objects[obj_index].attrs[attr_index].units == b'' assert eflr.objects[obj_index].attrs[attr_index].value == [8, 10]
def test_ObjectName_ctor_eq(args, expected): object_name = RepCode.ObjectName(*args) assert object_name == expected
def test_ObjectName_ctor_eq_false(): object_name = RepCode.ObjectName(1, 2, b'') assert not object_name == 1 assert not 1 == object_name
def test_ObjectName_str(args, expected): object_name = RepCode.ObjectName(*args) assert str(object_name) == expected
def test_log_pass_frame_channel_numpy_indexes(): log_pass = _log_pass() frame_array = log_pass[FRAME_ARRAY_IDENT] channel = frame_array[RepCode.ObjectName(O=11, C=0, I=b'DEPT')] assert list(channel.numpy_indexes(0)) == [(0, 0)]
def test_ObjectName_format(args, fmt, expected): object_name = RepCode.ObjectName(*args) assert f'{object_name:{fmt}}' == expected
# Data from PRASLIN-1_MWD_SUITE1_RUN1_HDS1-L_SURVEY_0MD-2125MD_EOS.dlis # 9 channels and 83 frames but here are just the frames [1:9] BYTES_EFLR_CHANNEL = b'\xf8\x07CHANNEL\x0259<\tLONG-NAME\x00\x14<\nPROPERTIES\x00\x14<\x13REPRESENTATION-CODE\x00\x0e<\x05UNITS\x00\x14<\tDIMENSION\x00\x0e<\x04AXIS\x00\x17<\rELEMENT-LIMIT\x00\x0e<\x06SOURCE\x00\x18<\tRELOG-NUM\x00\x0ep\x0b\x00\x04DEPT)\x01\x1aMWD Tool Measurement Depth\x00)\x01\x00\x00\x00\x02)\x01\x060.1 in)\x01\x00\x00\x00\x01\x00)\x01\x00\x00\x00\x01\x00)\x01\x00\x00\x00\x00p\x0b\x00\x03INC)\x01\x0bInclination\x00)\x01\x00\x00\x00\x02)\x01\x03deg)\x01\x00\x00\x00\x01\x00)\x01\x00\x00\x00\x01\x00)\x01\x00\x00\x00\x00p\x0b\x00\x03AZI)\x01\x07Azimuth\x00)\x01\x00\x00\x00\x02)\x01\x03deg)\x01\x00\x00\x00\x01\x00)\x01\x00\x00\x00\x01\x00)\x01\x00\x00\x00\x00p\x0b\x00\x05MTTVD)\x01\x18MWD Tool Measurement TVD\x00)\x01\x00\x00\x00\x02)\x01\x01m)\x01\x00\x00\x00\x01\x00)\x01\x00\x00\x00\x01\x00)\x01\x00\x00\x00\x00p\x0b\x00\x04SECT)\x01\x07Section\x00)\x01\x00\x00\x00\x02)\x01\x01m)\x01\x00\x00\x00\x01\x00)\x01\x00\x00\x00\x01\x00)\x01\x00\x00\x00\x00p\x0b\x00\x03RCN)\x01\x1eRectangular Co-ordinates North\x00)\x01\x00\x00\x00\x02)\x01\x01m)\x01\x00\x00\x00\x01\x00)\x01\x00\x00\x00\x01\x00)\x01\x00\x00\x00\x00p\x0b\x00\x03RCE)\x01\x1dRectangular Co-ordinates East\x00)\x01\x00\x00\x00\x02)\x01\x01m)\x01\x00\x00\x00\x01\x00)\x01\x00\x00\x00\x01\x00)\x01\x00\x00\x00\x00p\x0b\x00\x05DLSEV)\x01\x10Dog-leg Severity\x00)\x01\x00\x00\x00\x02)\x01\x07deg/30m)\x01\x00\x00\x00\x01\x00)\x01\x00\x00\x00\x01\x00)\x01\x00\x00\x00\x00p\x0b\x00\x04TLTS)\x01\x17Tool Temperature Static\x00)\x01\x00\x00\x00\x02)\x01\x04degC)\x01\x00\x00\x00\x01\x00)\x01\x00\x00\x00\x01\x00)\x01\x00\x00\x00\x00' BYTES_EFLR_FRAME = b'\xf8\x05FRAME\x0260<\x0bDESCRIPTION\x00\x14<\x08CHANNELS\x00\x17<\nINDEX-TYPE\x00\x14<\tDIRECTION\x00\x14>\x07SPACING\x00\x02\x060.1 in<\tENCRYPTED\x00\x0e>\tINDEX-MIN\x00\x02\x060.1 in>\tINDEX-MAX\x00\x02\x060.1 inp\x0b\x00\x020B\x00)\t\x0b\x00\x04DEPT\x0b\x00\x03INC\x0b\x00\x03AZI\x0b\x00\x05MTTVD\x0b\x00\x04SECT\x0b\x00\x03RCN\x0b\x00\x03RCE\x0b\x00\x05DLSEV\x0b\x00\x04TLTS)\x01\x0eBOREHOLE-DEPTH\x00+\x01\x060.1 in\x00\x00\x00\x00)\x01\x00\x00\x00\x00+\x01\x060.1 in\x00\x00\x00\x00+\x01\x060.1 inILJ\xb0' # NOTE: Missing first IFLR as is seems to be all nulls. IFLR_BYTES = [ b'\x0b\x00\x020B\x02G\x92\xde\x80?\x00\x01T\x00\x00\x00\x00C>\xffa?U[6?U[6\x00\x00\x00\x00=\xa1\xee\x7f\xc4y\xd0\x00', b'\x0b\x00\x020B\x03H\x17\x19\x00?\x00\x01T\x00\x00\x00\x00C\xc4~\xb4@&)\x0b@&)\x0b\x00\x00\x00\x00\x00\x00\x00\x00\xc4y\xd0\x00', b'\x0b\x00\x020B\x04He\x1b\x80?@\x00\x1d\x00\x00\x00\x00D\x14\xf8,@\x99\xe7\xc9@\x99\xe7\xc9\x00\x00\x00\x00=\x1a\xe4!\xc4y\xd0\x00', b'\x0b\x00\x020B\x05H\x97\xde\x00?\x00\x01T\x00\x00\x00\x00DE}\xd2@\xdd\xa8\xac@\xdd\xa8\xac\x00\x00\x00\x00=\x1a\xe4!\xc4y\xd0\x00', b'\x0b\x00\x020B\x06H\xba\x15\xc0?\x7f\xfe\xe7\x00\x00\x00\x00Dq\xfc\xcfA\x14\x1b\xccA\x14\x1b\xcc\x00\x00\x00\x00=\xac~\r\xc4y\xd0\x00', b'\x0b\x00\x020B\x07H\xbc\xe2\xe0?xQ\xe8CHp\xa4Du\xa1=A\x14K8A\x14K8\xbd0mP@\x7fp7BI\x93&', b'\x0b\x00\x020B\x08H\xd1\x14 ?xQ\xe8CMs3D\x87\xf1k@\xf4<\xb8@\xf4<\xb8\xbf<R\xf8<\xc5"XBa\xabQ', b"\x0b\x00\x020B\tH\xda\x9d\x00?33/CN.\x14D\x8e$s@\xdfg\xc3@\xdfg\xc3\xbf\x86]}>'6FBi\xb3h", ] FRAME_ARRAY_IDENT = RepCode.ObjectName(O=11, C=0, I=b'0B') @pytest.mark.parametrize( 'by', ( BYTES_EFLR_CHANNEL, BYTES_EFLR_FRAME, ) ) def test_logical_data_constructs(by): File.LogicalData(by) @pytest.mark.parametrize( 'lr_type, by', ( (3, BYTES_EFLR_CHANNEL),
def test_ObjectName_lt(args_0, args_1, expected_0_1, expected_1_0): object_0 = RepCode.ObjectName(*args_0) object_1 = RepCode.ObjectName(*args_1) assert (object_0 < object_1) == expected_0_1 assert (object_1 < object_0) == expected_1_0