How to use the h5netcdf.core.CompatibilityError function in h5netcdf

To help you get started, we’ve selected a few h5netcdf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shoyer / h5netcdf / h5netcdf / core.py View on Github external
def _invalid_netcdf_feature(feature, allow, file, stacklevel=0):
    if allow is None:
        msg = ('{} are supported by h5py, but not part of the NetCDF API. '
               'You are writing an HDF5 file that is not a valid NetCDF file! '
               'In the future, this will be an error, unless you set '
               'invalid_netcdf=True.'.format(feature))
        warnings.warn(msg, FutureWarning, stacklevel=stacklevel)
        file._write_ncproperties = False
    elif not allow:
        msg = ('{} are not a supported NetCDF feature, and are not allowed by '
               'h5netcdf unless invalid_netcdf=True.'.format(feature))
        raise CompatibilityError(msg)