Skip to content

Warning with last xarray '2024.1.1' #41

@gmaze

Description

@gmaze

when loading a pyxpcm netcdf model file I now have the following deprecation warning:

/Users/gmaze/miniconda3/envs/bc-monitor/lib/python3.9/site-packages/xarray/namedarray/core.py:487: UserWarning: 
Duplicate dimension names present: dimensions {'GMM_DIM'} appear more than once in 
dims=('K', 'GMM_DIM', 'GMM_DIM'). We do not yet support duplicate dimension names, 
but we do allow initial construction of the object. We recommend you rename the dims 
immediately to become distinct, as most xarray functionality is likely to fail silently if you do not. 
To rename the dimensions you will need to set the ``.dims`` attribute of each variable, 
``e.g. var.dims=('x0', 'x1')``.

this is coming from the classifier netcdf group:

group: classifier {
  dimensions:
        K = 4 ;
        GMM_DIM = 30 ;
  variables:
        int64 K(K) ;
        double prior(K) ;
                prior:_FillValue = NaN ;
                prior:long_name = "Mixture component priors" ;
        int64 GMM_DIM(GMM_DIM) ;
        double center(K, GMM_DIM) ;
                center:_FillValue = NaN ;
                center:long_name = "Mixture component centers" ;
        double covariance(K, GMM_DIM, GMM_DIM) ;
                covariance:_FillValue = NaN ;
                covariance:long_name = "Mixture component covariances" ;
                covariance:initial_shape = "full" ;
        double precision(K, GMM_DIM, GMM_DIM) ;
                precision:_FillValue = NaN ;
                precision:long_name = "Mixture component precisions" ;
                precision:comment = "A precision matrix is the inverse of a covariance matrix.Storing the precision matrices instead of the covariance matrices makes it more efficient to compute the log-likelihood of new samples." ;
                precision:initial_shape = "full" ;
        double precision_cholesky(K, GMM_DIM, GMM_DIM) ;
                precision_cholesky:_FillValue = NaN ;
                precision_cholesky:long_name = "Mixture component Cholesky precisions" ;
                precision_cholesky:comment = "Cholesky decomposition of the precision matrices of each mixture component." ;
                precision_cholesky:initial_shape = "full" ;
        string dimension_name(GMM_DIM) ;
                dimension_name:long_name = "Name of reduced dimensions" ;

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions