# Buggy code
def get_dataset(self, key, info):
    """Get calibrated channel data."""
    if self.mdrs is None:
        self._read_all(self.filename)

    if key.name in ["longitude", "latitude"]:
        lons, lats = self.get_full_lonlats()
        if key.name == "longitude":
            dataset = create_xarray(lons)
        else:
            dataset = create_xarray(lats)

    elif key.name in [
        "solar_zenith_angle",
        "solar_azimuth_angle",
        "satellite_zenith_angle",
        "satellite_azimuth_angle",
    ]:
        sun_azi, sun_zen, sat_azi, sat_zen = self.get_full_angles()
        if key.name == "solar_zenith_angle":
            dataset = create_xarray(sun_zen)
        elif key.name == "solar_azimuth_angle":
            dataset = create_xarray(sun_azi)
        if key.name == "satellite_zenith_angle":
            dataset = create_xarray(sat_zen)
        elif key.name == "satellite_azimuth_angle":
            dataset = create_xarray(sat_azi)
    else:
        mask = None
        if key.calibration == "counts":
            raise ValueError(
                "calibration=counts is not supported! "
                + "This reader cannot return counts"
            )
        elif key.calibration not in [
            "reflectance",
            "brightness_temperature",
            "radiance",
        ]:
            raise ValueError(
                "calibration type " + str(key.calibration) + " is not supported!"
            )

        if key.name in ["3A", "3a"] and self.three_a_mask is None:
            self.three_a_mask = (self["FRAME_INDICATOR"] & 2**16) != 2**16

        if key.name in ["3B", "3b"] and self.three_b_mask is None:
            self.three_b_mask = (self["FRAME_INDICATOR"] & 2**16) != 0

        if key.name not in ["1", "2", "3a", "3A", "3b", "3B", "4", "5"]:
            LOG.info("Can't load channel in eps_l1b: " + str(key.name))
            return

        if key.name == "1":
            if key.calibration == "reflectance":
                array = radiance_to_refl(
                    self["SCENE_RADIANCES"][:, 0, :],
                    self["CH1_SOLAR_FILTERED_IRRADIANCE"],
                )
            else:
                array = self["SCENE_RADIANCES"][:, 0, :]

        if key.name == "2":
            if key.calibration == "reflectance":
                array = radiance_to_refl(
                    self["SCENE_RADIANCES"][:, 1, :],
                    self["CH2_SOLAR_FILTERED_IRRADIANCE"],
                )
            else:
                array = self["SCENE_RADIANCES"][:, 1, :]

        if key.name.lower() == "3a":
            if key.calibration == "reflectance":
                array = radiance_to_refl(
                    self["SCENE_RADIANCES"][:, 2, :],
                    self["CH3A_SOLAR_FILTERED_IRRADIANCE"],
                )
            else:
                array = self["SCENE_RADIANCES"][:, 2, :]

            mask = np.empty(array.shape, dtype=bool)
            mask[:, :] = self.three_a_mask[:, np.newaxis]

        if key.name.lower() == "3b":
            if key.calibration == "brightness_temperature":
                array = radiance_to_bt(
                    self["SCENE_RADIANCES"][:, 2, :],
                    self["CH3B_CENTRAL_WAVENUMBER"],
                    self["CH3B_CONSTANT1"],
                    self["CH3B_CONSTANT2_SLOPE"],
                )
            else:
                array = self["SCENE_RADIANCES"][:, 2, :]
            mask = np.empty(array.shape, dtype=bool)
            mask[:, :] = self.three_b_mask[:, np.newaxis]

        if key.name == "4":
            if key.calibration == "brightness_temperature":
                array = radiance_to_bt(
                    self["SCENE_RADIANCES"][:, 3, :],
                    self["CH4_CENTRAL_WAVENUMBER"],
                    self["CH4_CONSTANT1"],
                    self["CH4_CONSTANT2_SLOPE"],
                )
            else:
                array = self["SCENE_RADIANCES"][:, 3, :]

        if key.name == "5":
            if key.calibration == "brightness_temperature":
                array = radiance_to_bt(
                    self["SCENE_RADIANCES"][:, 4, :],
                    self["CH5_CENTRAL_WAVENUMBER"],
                    self["CH5_CONSTANT1"],
                    self["CH5_CONSTANT2_SLOPE"],
                )
            else:
                array = self["SCENE_RADIANCES"][:, 4, :]

        dataset = create_xarray(array)
        if mask is not None:
            dataset = dataset.where(~mask)

    dataset.attrs["platform_name"] = self.platform_name
    dataset.attrs["sensor"] = self.sensor_name
    dataset.attrs.update(info)
    dataset.attrs.update(key.to_dict())
    return dataset


# Traceback (ValueError)
[DEBUG: 2019-10-08 10:34:09 : satpy.readers.eps_l1b] Reading /data/pytroll/testdata/eps-l1b/avhrr_metop02_20191008055203_20191008062503.eps
[ERROR: 2019-10-08 10:34:13 : satpy.readers.yaml_reader] Could not load dataset 'DatasetID(name='longitude', wavelength=None, resolution=1050, polarization=None, calibration=None, level=None, modifiers=())': Too many ('veadr', 1)
Traceback (most recent call last):
File "/software/pytroll/lib/python3.5/site-packages/satpy/readers/yaml_reader.py", line 722, in _load_dataset_with_area
ds = self._load_dataset_data(file_handlers, dsid)
File "/software/pytroll/lib/python3.5/site-packages/satpy/readers/yaml_reader.py", line 602, in _load_dataset_data
proj = self._load_dataset(dsid, ds_info, file_handlers)
File "/software/pytroll/lib/python3.5/site-packages/satpy/readers/yaml_reader.py", line 578, in _load_dataset
projectable = fh.get_dataset(dsid, ds_info)
File "/software/pytroll/lib/python3.5/site-packages/satpy/readers/eps_l1b.py", line 309, in get_dataset
self._read_all(self.filename)
File "/software/pytroll/lib/python3.5/site-packages/satpy/readers/eps_l1b.py", line 174, in _read_all
raise ValueError("Too many " + str((rec_class, sub_class)))
ValueError: Too many ('veadr', 1)
[DEBUG: 2019-10-08 10:34:13 : satpy.readers.yaml_reader] No coordinates found for DatasetID(name='latitude', wavelength=None, resolution=1050, polarization=None, calibration=None, level=None, modifiers=())
Traceback (most recent call last):
File "/software/pytroll/scripts/test-veadr.py", line 10, in <module>
global_scene.load(['overview'])
File "/software/pytroll/lib/python3.5/site-packages/satpy/scene.py", line 967, in load
self.read(**kwargs)
File "/software/pytroll/lib/python3.5/site-packages/satpy/scene.py", line 875, in read
return self._read_datasets(nodes, **kwargs)
File "/software/pytroll/lib/python3.5/site-packages/satpy/scene.py", line 716, in _read_datasets
new_datasets = reader_instance.load(ds_ids, **kwargs)
File "/software/pytroll/lib/python3.5/site-packages/satpy/readers/yaml_reader.py", line 794, in load
ds = self._load_dataset_with_area(dsid, coords)
File "/software/pytroll/lib/python3.5/site-packages/satpy/readers/yaml_reader.py", line 722, in _load_dataset_with_area
ds = self._load_dataset_data(file_handlers, dsid)
File "/software/pytroll/lib/python3.5/site-packages/satpy/readers/yaml_reader.py", line 602, in _load_dataset_data
proj = self._load_dataset(dsid, ds_info, file_handlers)
File "/software/pytroll/lib/python3.5/site-packages/satpy/readers/yaml_reader.py", line 578, in _load_dataset
projectable = fh.get_dataset(dsid, ds_info)
File "/software/pytroll/lib/python3.5/site-packages/satpy/readers/eps_l1b.py", line 312, in get_dataset
lons, lats = self.get_full_lonlats()
File "/software/pytroll/lib/python3.5/site-packages/satpy/readers/eps_l1b.py", line 232, in get_full_lonlats
shape=(self.scanlines, self.pixels))
File "/software/pytroll/lib/python3.5/site-packages/dask/array/core.py", line 2406, in from_delayed
return Array(graph, name, chunks, dtype)
File "/software/pytroll/lib/python3.5/site-packages/dask/array/core.py", line 880, in __new__
self._chunks = normalize_chunks(chunks, shape, dtype=self.dtype)
File "/software/pytroll/lib/python3.5/site-packages/dask/array/core.py", line 1995, in normalize_chunks
return tuple(tuple(int(x) if not math.isnan(x) else x for x in c) for c in chunks)
File "/software/pytroll/lib/python3.5/site-packages/dask/array/core.py", line 1995, in <genexpr>
return tuple(tuple(int(x) if not math.isnan(x) else x for x in c) for c in chunks)
File "/software/pytroll/lib/python3.5/site-packages/dask/array/core.py", line 1995, in <genexpr>
return tuple(tuple(int(x) if not math.isnan(x) else x for x in c) for c in chunks)
TypeError: a float is required

# Fixed code
def get_dataset(self, key, info):
    """Get calibrated channel data."""
    if self.sections is None:
        self._read_all()

    if key.name in ["longitude", "latitude"]:
        lons, lats = self.get_full_lonlats()
        if key.name == "longitude":
            dataset = create_xarray(lons)
        else:
            dataset = create_xarray(lats)

    elif key.name in [
        "solar_zenith_angle",
        "solar_azimuth_angle",
        "satellite_zenith_angle",
        "satellite_azimuth_angle",
    ]:
        sun_azi, sun_zen, sat_azi, sat_zen = self.get_full_angles()
        if key.name == "solar_zenith_angle":
            dataset = create_xarray(sun_zen)
        elif key.name == "solar_azimuth_angle":
            dataset = create_xarray(sun_azi)
        if key.name == "satellite_zenith_angle":
            dataset = create_xarray(sat_zen)
        elif key.name == "satellite_azimuth_angle":
            dataset = create_xarray(sat_azi)
    else:
        mask = None
        if key.calibration == "counts":
            raise ValueError(
                "calibration=counts is not supported! "
                + "This reader cannot return counts"
            )
        elif key.calibration not in [
            "reflectance",
            "brightness_temperature",
            "radiance",
        ]:
            raise ValueError(
                "calibration type " + str(key.calibration) + " is not supported!"
            )

        if key.name in ["3A", "3a"] and self.three_a_mask is None:
            self.three_a_mask = (self["FRAME_INDICATOR"] & 2**16) != 2**16

        if key.name in ["3B", "3b"] and self.three_b_mask is None:
            self.three_b_mask = (self["FRAME_INDICATOR"] & 2**16) != 0

        if key.name not in ["1", "2", "3a", "3A", "3b", "3B", "4", "5"]:
            logger.info("Can't load channel in eps_l1b: " + str(key.name))
            return

        if key.name == "1":
            if key.calibration == "reflectance":
                array = radiance_to_refl(
                    self["SCENE_RADIANCES"][:, 0, :],
                    self["CH1_SOLAR_FILTERED_IRRADIANCE"],
                )
            else:
                array = self["SCENE_RADIANCES"][:, 0, :]

        if key.name == "2":
            if key.calibration == "reflectance":
                array = radiance_to_refl(
                    self["SCENE_RADIANCES"][:, 1, :],
                    self["CH2_SOLAR_FILTERED_IRRADIANCE"],
                )
            else:
                array = self["SCENE_RADIANCES"][:, 1, :]

        if key.name.lower() == "3a":
            if key.calibration == "reflectance":
                array = radiance_to_refl(
                    self["SCENE_RADIANCES"][:, 2, :],
                    self["CH3A_SOLAR_FILTERED_IRRADIANCE"],
                )
            else:
                array = self["SCENE_RADIANCES"][:, 2, :]

            mask = np.empty(array.shape, dtype=bool)
            mask[:, :] = self.three_a_mask[:, np.newaxis]

        if key.name.lower() == "3b":
            if key.calibration == "brightness_temperature":
                array = radiance_to_bt(
                    self["SCENE_RADIANCES"][:, 2, :],
                    self["CH3B_CENTRAL_WAVENUMBER"],
                    self["CH3B_CONSTANT1"],
                    self["CH3B_CONSTANT2_SLOPE"],
                )
            else:
                array = self["SCENE_RADIANCES"][:, 2, :]
            mask = np.empty(array.shape, dtype=bool)
            mask[:, :] = self.three_b_mask[:, np.newaxis]

        if key.name == "4":
            if key.calibration == "brightness_temperature":
                array = radiance_to_bt(
                    self["SCENE_RADIANCES"][:, 3, :],
                    self["CH4_CENTRAL_WAVENUMBER"],
                    self["CH4_CONSTANT1"],
                    self["CH4_CONSTANT2_SLOPE"],
                )
            else:
                array = self["SCENE_RADIANCES"][:, 3, :]

        if key.name == "5":
            if key.calibration == "brightness_temperature":
                array = radiance_to_bt(
                    self["SCENE_RADIANCES"][:, 4, :],
                    self["CH5_CENTRAL_WAVENUMBER"],
                    self["CH5_CONSTANT1"],
                    self["CH5_CONSTANT2_SLOPE"],
                )
            else:
                array = self["SCENE_RADIANCES"][:, 4, :]

        dataset = create_xarray(array)
        if mask is not None:
            dataset = dataset.where(~mask)

    dataset.attrs["platform_name"] = self.platform_name
    dataset.attrs["sensor"] = self.sensor_name
    dataset.attrs.update(info)
    dataset.attrs.update(key.to_dict())
    return dataset