1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
"""
Phase 4 tests — CSV export.
Covers the to_csv() method with all combinations of mnemonic headers, units
placement options (separate line, brackets, parentheses, omitted), and
explicit mnemonic list overrides.
All tests are marked xfail because the `las_rs` Rust extension has not yet
been implemented.
"""
=
return
# ---------------------------------------------------------------------------
# Helper
# ---------------------------------------------------------------------------
=
return
"""Call to_csv(**kwargs) on *las* and return the non-empty output lines."""
=
return
# ---------------------------------------------------------------------------
# Basic output
# ---------------------------------------------------------------------------
"""to_csv() writes one data row per depth step; the number of data lines
equals the number of rows in the LASFile's data array."""
=
=
# The fixture has 6 depth steps; expect at least 6 data lines
assert >= 6
# ---------------------------------------------------------------------------
# Mnemonic header row
# ---------------------------------------------------------------------------
"""mnemonics=True inserts a header row whose columns are the curve
mnemonics."""
=
=
=
assert in
# ---------------------------------------------------------------------------
# Units placement — separate line
# ---------------------------------------------------------------------------
"""units_loc='line' places units on a dedicated second line, separate
from the mnemonics row."""
=
=
# With a separate units line there must be at least 2 header lines before
# the first numeric row.
assert >= 2
# The units line should contain the DEPT unit 'M' (or whatever the fixture
# uses) but NOT any mnemonic like 'DEPT' unless they coincidentally match.
=
assert in # DEPT unit from v12 fixture
# ---------------------------------------------------------------------------
# Units placement — brackets
# ---------------------------------------------------------------------------
"""units_loc='[]' embeds units inside square brackets after each mnemonic
(e.g. 'DEPT[M]')."""
=
=
=
# Depth curve should appear as DEPT[M] or similar
assert in and in
# ---------------------------------------------------------------------------
# Units placement — parentheses
# ---------------------------------------------------------------------------
"""units_loc='()' embeds units inside parentheses after each mnemonic
(e.g. 'DEPT(M)')."""
=
=
=
assert in and in
# ---------------------------------------------------------------------------
# No units
# ---------------------------------------------------------------------------
"""units=False (or units_loc=None) omits any unit information from the
output; the mnemonic row contains only bare mnemonics."""
=
=
=
# The unit 'GAPI' (GR unit in v12 fixture) must NOT appear in the header
assert not in
# But the mnemonic itself must still be there
assert in
# ---------------------------------------------------------------------------
# Custom mnemonic list
# ---------------------------------------------------------------------------