Skip to content

Commit 9b86c75

Browse files
authored
Merge branch 'main' into update_segy_export
2 parents 208b02e + b026d60 commit 9b86c75

33 files changed

Lines changed: 2508 additions & 637 deletions

docs/configuration.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ You can find a summary of the available variables and their defaults below.
1818
| `MDIO__EXPORT__CPU_COUNT` | `int` | Number of logical CPUs available |
1919
| `MDIO__GRID__SPARSITY_RATIO_WARN` | `float` | `2.0` |
2020
| `MDIO__GRID__SPARSITY_RATIO_LIMIT` | `float` | `10.0` |
21-
| `MDIO__IMPORT__SAVE_SEGY_FILE_HEADER` | `bool` | `False` |
21+
| `MDIO__IMPORT__SAVE_SEGY_FILE_HEADER` | `int` | `0` |
2222
| `MDIO__IMPORT__CLOUD_NATIVE` | `bool` | `False` |
2323
| `MDIO__IMPORT__RAW_HEADERS` | `bool` | `False` |
2424
| `MDIO_IGNORE_CHECKS` | `bool` | `False` |
@@ -71,13 +71,29 @@ $ export MDIO__GRID__SPARSITY_RATIO_LIMIT=15.0
7171

7272
### `MDIO__IMPORT__SAVE_SEGY_FILE_HEADER`
7373

74-
**Accepted values:** `true`, `false`, `1`, `0`, `yes`, `no`, `on`, `off`
74+
**Accepted values:** `0`, `1`, `2`, `true`, `false`, `yes`, `no`, `on`, `off`
75+
76+
Controls preservation of the original SEG-Y textual file header during import.
77+
The textual file header must be 40 lines of 80 printable characters per the
78+
SEG-Y standard; lossy EBCDIC decoding can produce headers that violate this
79+
layout. The variable selects how MDIO reacts:
80+
81+
| Value | Behavior |
82+
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
83+
| `0` / `false` | Do not save SEG-Y file headers (default). |
84+
| `1` / `true` | Save SEG-Y file headers and raise `ValueError` if the text header is not exactly 40x80 ASCII-printable characters (rejects e.g. `U+FFFD` from a lossy EBCDIC decode). |
85+
| `2` | Save SEG-Y file headers; if the text header is malformed, log a warning and correct it (non-ASCII or non-printable characters become spaces and rows pad to 80x40). |
7586

76-
When enabled, preserves the original SEG-Y textual file header during import.
77-
This is useful for maintaining full SEG-Y standard compliance and preserving survey metadata.
87+
```{note}
88+
On export, `mdio_to_segy` always defensively validates the stored text header
89+
and, if it cannot be re-encoded as ASCII (for example because the store was
90+
written by an older version of MDIO that accepted lossy EBCDIC decodes),
91+
repairs it on the fly and emits a warning. Re-ingest the source SEG-Y with
92+
mode `1` or `2` to silence the warning permanently.
93+
```
7894

7995
```shell
80-
$ export MDIO__IMPORT__SAVE_SEGY_FILE_HEADER=true
96+
$ export MDIO__IMPORT__SAVE_SEGY_FILE_HEADER=1
8197
$ mdio segy import input.segy output.mdio --header-locations 189,193
8298
```
8399

noxfile.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
python_versions = ["3.13", "3.12", "3.11"]
2525
nox.needs_version = ">=2025.2.9"
2626
nox.options.default_venv_backend = "uv"
27+
nox.options.reuse_venv = "yes"
2728
nox.options.sessions = ("pre-commit", "safety", "mypy", "tests", "typeguard", "xdoctest", "docs-build")
2829

2930

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "multidimio"
3-
version = "1.1.2"
3+
version = "1.1.3"
44
description = "Cloud-native, scalable, and user-friendly multi dimensional energy data!"
55
authors = [{ name = "Altay Sansal", email = "altay.sansal@tgs.com" }]
66
requires-python = ">=3.11,<3.14"
@@ -31,7 +31,7 @@ dependencies = [
3131
"tqdm>=4.67.1",
3232
"universal-pathlib>=0.3.3",
3333
"xarray>=2025.10.1",
34-
"zarr>=3.1.3",
34+
"zarr>=3.1.3,<=3.1.6",
3535
]
3636

3737
[project.optional-dependencies]
@@ -183,7 +183,7 @@ init_typed = true
183183
warn_required_dynamic_aliases = true
184184

185185
[tool.bumpversion]
186-
current_version = "1.1.2"
186+
current_version = "1.1.3"
187187
allow_dirty = true
188188
commit = false
189189
tag = false

0 commit comments

Comments
 (0)