Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
BrianMichell opened this issue Dec 18, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@BrianMichell
Copy link
Collaborator

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.

@BrianMichell BrianMichell added the bug Something isn't working label Dec 18, 2024
@BrianMichell BrianMichell self-assigned this Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant