Skip to content

Commit f580e2d

Browse files
authored
Merge pull request #52 from sanath-2024/main
Use dimension separator in arrays instead of `FSStore`
2 parents 6f0372c + bde1944 commit f580e2d

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
/dist/
88
/docs/_build/
99
/src/*.egg-info/
10+
/*__pycache__/

src/mdio/api/io_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ def process_url(
6666
check=check,
6767
create=check,
6868
mode=mode,
69-
dimension_separator="/",
7069
**storage_options,
7170
)
7271

src/mdio/converters/segy.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ def segy_to_mdio(
213213
name="live_mask",
214214
shape=grid.shape[:-1],
215215
chunks=-1,
216+
dimension_separator="/",
216217
)
217218

218219
write_attribute(

src/mdio/segy/blocked_io.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def to_zarr(
8686
shape=grid.shape,
8787
compressor=trace_compressor,
8888
chunks=chunks,
89+
dimension_separator="/",
8990
**kwargs,
9091
)
9192

@@ -116,6 +117,7 @@ def to_zarr(
116117
chunks=chunks[:-1], # Same spatial chunks as data
117118
compressor=header_compressor,
118119
dtype=header_dtype,
120+
dimension_separator="/",
119121
)
120122

121123
# Initialize chunk iterator (returns next chunk slice indices each iteration)

tests/unit/conftest.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
def mock_store(tmp_path_factory):
3434
"""Make a mocked MDIO store for writing."""
3535
tmp_dir = tmp_path_factory.mktemp("mdio")
36-
return FSStore(tmp_dir.name, dimension_separator="/")
36+
return FSStore(tmp_dir.name)
3737

3838

3939
@pytest.fixture
@@ -106,6 +106,7 @@ def mock_mdio(
106106
name="live_mask",
107107
shape=grid.shape[:-1],
108108
chunks=-1,
109+
dimension_separator="/",
109110
)
110111

111112
write_attribute(name="created", zarr_group=zarr_root, attribute=str(datetime.now()))
@@ -124,13 +125,18 @@ def mock_mdio(
124125
for key, value in stats.items():
125126
write_attribute(name=key, zarr_group=zarr_root, attribute=value)
126127

127-
data_arr = data_grp.create_dataset("chunked_012", data=mock_data)
128+
data_arr = data_grp.create_dataset(
129+
"chunked_012",
130+
data=mock_data,
131+
dimension_separator="/",
132+
)
128133

129134
metadata_grp.create_dataset(
130135
data=il_grid * xl_grid,
131136
name="_".join(["chunked_012", "trace_headers"]),
132137
shape=grid.shape[:-1], # Same spatial shape as data
133138
chunks=data_arr.chunks[:-1], # Same spatial chunks as data
139+
dimension_separator="/",
134140
)
135141

136142
consolidate_metadata(mock_store)

0 commit comments

Comments
 (0)