Skip to content

File separator characters in Variable names causes shift in dataset metadata write #150

Description

@BrianMichell
import xarray as xr
import numpy as np

# Create coordinate arrays
x = np.arange(0, 10, 1)  # 10 points along X
y = np.arange(0, 5, 1)   # 5 points along Y

# Create some example 2D data (here we'll use a simple grid pattern)
data = np.random.rand(len(y), len(x))  # 5x10 grid of random values

# Create the dataset
ds = xr.Dataset(
    data_vars={
        'DATA': (['Y', 'X/var'], data)  # Define data with dimensions
    },
    coords={
        'X/var': x,
        'Y': y
    }
)

# Print the dataset to see its structure
print(ds)

ds.to_zarr("test.zarr")

Sample program of the behavior MDIO should follow.

Updating hello_mdio with variable X updated to have the name X/var generates the .zmetadata file under dir X.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions