Skip to content

Commit 96e3287

Browse files
authored
Merge branch 'disaster_recovery_multiVersionSupport' into dr_for_profiling
2 parents c7e6c35 + 0df4785 commit 96e3287

File tree

8 files changed

+188
-262
lines changed

8 files changed

+188
-262
lines changed

.devcontainer/Dockerfile

Lines changed: 0 additions & 28 deletions
This file was deleted.

.devcontainer/Dockerfile.dev

Lines changed: 0 additions & 46 deletions
This file was deleted.

.devcontainer/devcontainer.json

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2-
// README at: https://github.com/devcontainers/templates/tree/main/src/python
31
{
4-
"build": {
5-
"dockerfile": "Dockerfile.dev",
6-
"context": ".."
7-
},
8-
// Use 'postCreateCommand' to run commands after the container is created.
9-
"postCreateCommand": {
10-
// "post_create_script": "bash ./.devcontainer/post-install.sh"
11-
},
12-
// Forward 8787 to enable us to view dask dashboard
13-
"forwardPorts": [8787],
2+
"image": "mcr.microsoft.com/devcontainers/python:1-3.13-bookworm",
143
// Configure tool-specific properties.
4+
"features": {
5+
"ghcr.io/va-h/devcontainers-features/uv:1": { "version": "0.8.15" }
6+
},
157
"customizations": {
16-
// Configure properties specific to VS Code.
178
"vscode": {
189
"settings": {
10+
"python.defaultInterpreterPath": "${containerWorkspaceFolder}/.venv/bin/python",
1911
"python.testing.pytestArgs": ["tests"],
2012
"python.testing.unittestEnabled": false,
2113
"python.testing.pytestEnabled": true
@@ -33,14 +25,17 @@
3325
"visualstudioexptteam.vscodeintellicode",
3426
"richie5um2.vscode-sort-json"
3527
]
28+
},
29+
"jetbrains": {
30+
"plugins": ["com.koxudaxi.pydantic", "com.koxudaxi.ruff"]
3631
}
3732
},
38-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
39-
// "remoteUser": "root",
40-
"updateRemoteUserUID": true,
4133
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/mdio-python,type=bind",
4234
"workspaceFolder": "/workspaces/mdio-python",
43-
"mounts": [
44-
// "source=${localWorkspaceFolder}/../DATA/,target=/DATA/,type=bind,consistency=cached"
45-
]
35+
// This installs the MDIO dev environment in the container. Put any customizations there.
36+
"postCreateCommand": "bash .devcontainer/post-create.sh",
37+
// Forward 8787 to enable us to view the dask dashboard
38+
"forwardPorts": [8787]
39+
// Add any mounts you want to use here.
40+
//"mounts": [ "source=${localWorkspaceFolder}/../DATA/,target=/DATA/,type=bind,consistency=cached" ]
4641
}

.devcontainer/post-create.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Sync the environment, installing the project editable and including dev dependencies
6+
uv sync
7+
8+
# Set Git safe directory to avoid ownership issues
9+
git config --global --add safe.directory "$PWD"
10+
11+
# Optional: If you need to reset GitHub host key for SSH (uncomment if necessary)
12+
# ssh-keygen -f "/home/vscode/.ssh/known_hosts" -R "github.com"

.devcontainer/post-install.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/mdio/builder/xarray_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def to_xarray_dataset(mdio_ds: Dataset) -> xr_Dataset: # noqa: PLR0912
211211

212212
# Add array attributes
213213
if v.metadata is not None:
214-
metadata_dict = v.metadata.model_dump(exclude_none=True, exclude={"chunkGrid"})
214+
metadata_dict = v.metadata.model_dump(exclude_none=True, exclude={"chunk_grid"})
215215
data_array.attrs.update(metadata_dict)
216216
if v.long_name:
217217
data_array.attrs["long_name"] = v.long_name

src/mdio/segy/_workers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import numpy as np
1111
from segy import SegyFile
12+
from segy.indexing import merge_cat_file
1213

1314
from mdio.api.io import to_mdio
1415
from mdio.builder.schemas.dtype import ScalarType
@@ -132,6 +133,7 @@ def trace_worker( # noqa: PLR0913
132133
if header_key in dataset.data_vars: # Keeping the `if` here to allow for more worker configurations
133134
worker_variables.append(header_key)
134135
if raw_header_key in dataset.data_vars:
136+
135137
do_reverse_transforms = True
136138
worker_variables.append(raw_header_key)
137139

@@ -156,12 +158,13 @@ def trace_worker( # noqa: PLR0913
156158
if raw_header_key in worker_variables:
157159
tmp_raw_headers = np.zeros_like(dataset[raw_header_key])
158160
tmp_raw_headers[not_null] = raw_headers.view("|V240")
161+
159162
ds_to_write[raw_header_key] = Variable(
160163
ds_to_write[raw_header_key].dims,
161164
tmp_raw_headers,
162165
attrs=ds_to_write[raw_header_key].attrs,
163166
encoding=ds_to_write[raw_header_key].encoding, # Not strictly necessary, but safer than not doing it.
164-
)
167+
165168

166169
del raw_headers # Manage memory
167170
data_variable = ds_to_write[data_variable_name]

0 commit comments

Comments
 (0)