Skip to content

Infer dimensions #13

@stefsmeets

Description

@stefsmeets

This crashes when constructing the dataset:

variables = 'zeff', 't_e'
dataset = h.get_variables(variables=variables, ids=ids)

with KeyError in xarray:

self = <xarray.Dataset>
Dimensions:  ($rho_tor_norm: 101)
Dimensions without coordinates: $rho_tor_norm
Data variables:
    z...loat64 1.761 1.761 1.761 ... 1.761 1.761 1.761
    t_e      ($rho_tor_norm) float64 7.566e+03 7.564e+03 ... 302.3 240.3
name = 'rho_tor_norm'

    def _construct_dataarray(self, name: Hashable) -> DataArray:
        """Construct a DataArray by indexing this dataset"""
        from xarray.core.dataarray import DataArray
    
        try:
>           variable = self._variables[name]
E           KeyError: 'rho_tor_norm'

It would be useful if imas2xarray would recognize 'time' and 'rho_tor_norm' as missing variables and automatically include them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions