Skip to content

Commit 0ba83e9

Browse files
committed
Cleanup prints
1 parent f7c841e commit 0ba83e9

File tree

5 files changed

+0
-53
lines changed

5 files changed

+0
-53
lines changed

src/mdio/converters/mdio.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,10 @@ def mdio_to_segy( # noqa: PLR0912, PLR0913
9191

9292
output_segy_path = Path(output_segy_path)
9393

94-
# mdio = MDIOReader(
95-
# mdio_path_or_buffer=mdio_path_or_buffer,
96-
# access_pattern=access_pattern,
97-
# storage_options=storage_options,
98-
# )
99-
10094
mdio = MDIO.open(mdio_path_or_buffer)
10195

10296
seismic_chunks = mdio.seismic.encoding.get("chunks", mdio.seismic.shape)
10397

104-
print(f"mdio.seismic.chunks: {seismic_chunks}")
105-
print(f"mdio.seismic.shape: {mdio.seismic.shape}")
106-
print(f"mdio.seismic.dtype: {mdio.seismic.dtype}")
107-
10898
if new_chunks is None:
10999
new_chunks = segy_export_rechunker(seismic_chunks, mdio.seismic.shape, mdio.seismic.dtype)
110100

@@ -129,9 +119,6 @@ def mdio_to_segy( # noqa: PLR0912, PLR0913
129119
else:
130120
mdio, segy_factory = mdio_spec_to_segy(*creation_args)
131121

132-
print(f"segy_factory: {segy_factory}")
133-
134-
# live_mask = mdio.live_mask.compute()
135122
live_mask = mdio.trace_mask.compute().to_numpy()
136123

137124
if selection_mask is not None:
@@ -152,17 +139,11 @@ def mdio_to_segy( # noqa: PLR0912, PLR0913
152139
dim_slices += (slice(start, stop),)
153140

154141
# Lazily pull the data with limits now, and limit mask so its the same shape.
155-
print(f"dim_slices: {dim_slices}")
156142
indexer = {}
157143
for dim, i in zip(mdio.trace_mask.dims, dim_slices):
158144
indexer[dim] = i
159145

160-
print(f"indexer: {indexer}")
161-
# live_mask = mdio.trace_mask.isel(dim_slices[:-1])
162-
# headers = mdio.headers.isel(dim_slices[:-1])
163-
# samples = mdio.seismic.isel(dim_slices[:-1])
164146
live_mask = mdio.trace_mask.isel(indexer)
165-
print(f"live_mask {live_mask}")
166147

167148
headers = mdio.headers.isel(indexer)
168149
samples = mdio.seismic.isel(indexer)

src/mdio/converters/segy.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -693,9 +693,6 @@ def segy_to_mdio_schematized(
693693
mdio_spec = mdio_segy_spec()
694694
mdio_spec.trace.header = get_mdio_header_defined_fields(ds)
695695

696-
# print(f"mdio_spec: {mdio_spec}")
697-
# raise ValueError("Stop here")
698-
699696
segy_settings = SegySettings(storage_options=storage_options_input)
700697
segy = SegyFile(url=segy_schema["path"], spec=mdio_spec, settings=segy_settings)
701698

@@ -725,9 +722,6 @@ def segy_to_mdio_schematized(
725722

726723
mdio_spec_grid = mdio_spec.customize(trace_header_fields=index_fields)
727724

728-
print(f"mdio_spec_grid: {mdio_spec_grid}")
729-
# raise ValueError("Stop here")
730-
731725
segy_grid = SegyFile(url=segy_schema["path"], spec=mdio_spec_grid, settings=segy_settings)
732726
dimensions, chunksize, index_headers = get_grid_plan(
733727
segy_file=segy_grid,
@@ -746,10 +740,6 @@ def segy_to_mdio_schematized(
746740
grid_density_qc(grid, num_traces)
747741
grid.build_map(index_headers)
748742

749-
# print(f"dimensions: {dimensions}")
750-
# print(f"chunksize: {chunksize}")
751-
# print(f"index_headers: {index_headers}")
752-
753743
# Set dimension coordinates
754744
new_coords = {dim.name: dim.coords for dim in dimensions}
755745
ds = ds.assign_coords(new_coords)

src/mdio/segy/_workers.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,6 @@ def trace_worker(
128128
if nonzero_count == 0:
129129
return None
130130

131-
# Flush data to Zarr
132-
# data_array.set_basic_selection(selection=chunk_indices, value=tmp_data)
133-
134-
# print("Writing data to the underlying array...")
135-
# print(f"Chunk indices: {chunk_indices}")
136-
# print(f"tmp_data shape: {tmp_data.shape}")
137-
# print(f"data_array shape: {data_array.shape}")
138-
139131
# Direct assignment to underlying data array
140132
data_array.data[chunk_indices] = tmp_data
141133
data_array.to_mdio(store=mdio_path_or_buffer, mode="r+")

src/mdio/segy/compat.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,11 @@ def get_mdio_header_defined_fields(mdio: MDIO) -> HeaderSpec:
3636
fields = []
3737
offset = 1
3838
for field_name, (field_dtype, _) in mdio.headers.dtype.fields.items():
39-
# print(f"field_name: {field_name}, field_dtype: {field_dtype}, offset: {offset}")
4039
# Convert NumPy dtype to string format
4140
format_str = str(field_dtype).replace('dtype(', '').replace(')', '')
4241
fields.append(HeaderField(name=field_name, byte=offset, format=format_str))
4342
offset += field_dtype.itemsize
4443

45-
print(f"Custom header fields offset: {offset}")
4644
return HeaderSpec(fields=fields, item_size=240)
4745

4846

src/mdio/segy/creation.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -107,23 +107,9 @@ def mdio_spec_to_segy( # noqa: PLR0913
107107

108108
# from segy.schema.HeaderSpec import HeaderField, HeaderSpec
109109
from segy.schema import HeaderField, HeaderSpec
110-
# fields = []
111-
# offset = 1
112-
# for field_name, (field_dtype, _) in mdio.headers.dtype.fields.items():
113-
# print(f"field_name: {field_name}, field_dtype: {field_dtype}, offset: {offset}")
114-
# # Convert NumPy dtype to string format
115-
# format_str = str(field_dtype).replace('dtype(', '').replace(')', '')
116-
# fields.append(HeaderField(name=field_name, byte=offset, format=format_str))
117-
# offset += field_dtype.itemsize
118-
119110
fields = get_mdio_header_defined_fields(mdio)
120-
121-
print(f"Before spec: {spec.trace}")
122-
# mdio_header_mapping = HeaderSpec(fields=fields)
123111
spec.trace.header = fields
124112

125-
print(f"After spec: {spec.trace}")
126-
127113
spec.endianness = Endianness(output_endian)
128114
factory = make_segy_factory(mdio, spec=spec)
129115

0 commit comments

Comments
 (0)