# Buggy code
def combine_info(self, all_infos):
    """Combine metadata for multiple datasets.

    When loading data from multiple files it can be non-trivial to combine
    things like start_time, end_time, start_orbit, end_orbit, etc.

    By default this method will produce a dictionary containing all values
    that were equal across **all** provided info dictionaries.

    Additionally it performs the logical comparisons to produce the
    following if they exist:

     - start_time
     - end_time
     - start_orbit
     - end_orbit

     Also, concatenate the areas.

    """
    combined_info = combine_info(*all_infos)
    if "start_time" not in combined_info and "start_time" in all_infos[0]:
        combined_info["start_time"] = min(i["start_time"] for i in all_infos)
    if "end_time" not in combined_info and "end_time" in all_infos[0]:
        combined_info["end_time"] = max(i["end_time"] for i in all_infos)
    if "start_orbit" not in combined_info and "start_orbit" in all_infos[0]:
        combined_info["start_orbit"] = min(i["start_orbit"] for i in all_infos)
    if "end_orbit" not in combined_info and "end_orbit" in all_infos[0]:
        combined_info["end_orbit"] = max(i["end_orbit"] for i in all_infos)

    try:
        area = SwathDefinition(
            lons=np.ma.vstack([info["area"].lons for info in all_infos]),
            lats=np.ma.vstack([info["area"].lats for info in all_infos]),
        )
        area.name = "_".join([info["area"].name for info in all_infos])
        combined_info["area"] = area
    except KeyError:
        pass

    return combined_info


# Traceback (AttributeError)
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] Saving datasets to NetCDF4/CF.
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No longitude and latitude data to save.
[INFO: 2017-12-12 08:14:04 : satpy.writers.cf_writer] No grid mapping to save.
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-24-58ece08c15f3> in <module>()
----> 1 lcl.save_datasets(writer='cf', filename='/tmp/foo.nc')

/home/lahtinep/Software/pytroll/packages/satpy/satpy/scene.pyc in save_datasets(self, writer, datasets, **kwargs)
632             datasets = self.datasets.values()
633         writer = self.get_writer(writer, **kwargs)
--> 634         writer.save_datasets(datasets, **kwargs)
635
636     def get_writer(self, writer="geotiff", **kwargs):

/home/lahtinep/Software/pytroll/packages/satpy/satpy/writers/cf_writer.pyc in save_datasets(self, datasets, filename, **kwargs)
176                     coords = [line_coord, pixel_coord]
177
--> 178                 domain = cf.Domain(dim=coords,
179                                    aux=aux,
180                                    ref=grid_mapping)

AttributeError: 'module' object has no attribute 'Domain'

# Fixed code
def combine_info(self, all_infos):
    """Combine metadata for multiple datasets.

    When loading data from multiple files it can be non-trivial to combine
    things like start_time, end_time, start_orbit, end_orbit, etc.

    By default this method will produce a dictionary containing all values
    that were equal across **all** provided info dictionaries.

    Additionally it performs the logical comparisons to produce the
    following if they exist:

     - start_time
     - end_time
     - start_orbit
     - end_orbit

     Also, concatenate the areas.

    """
    combined_info = combine_metadata(*all_infos)
    if "start_time" not in combined_info and "start_time" in all_infos[0]:
        combined_info["start_time"] = min(i["start_time"] for i in all_infos)
    if "end_time" not in combined_info and "end_time" in all_infos[0]:
        combined_info["end_time"] = max(i["end_time"] for i in all_infos)
    if "start_orbit" not in combined_info and "start_orbit" in all_infos[0]:
        combined_info["start_orbit"] = min(i["start_orbit"] for i in all_infos)
    if "end_orbit" not in combined_info and "end_orbit" in all_infos[0]:
        combined_info["end_orbit"] = max(i["end_orbit"] for i in all_infos)

    try:
        area = SwathDefinition(
            lons=np.ma.vstack([info["area"].lons for info in all_infos]),
            lats=np.ma.vstack([info["area"].lats for info in all_infos]),
        )
        area.name = "_".join([info["area"].name for info in all_infos])
        combined_info["area"] = area
    except KeyError:
        pass

    return combined_info