docs: def check_lat_extents(self, ds):
          '''
          Check that the values of geospatial_lat_min/geospatial_lat_max
          approximately match the data.
  
          :param netCDF4.Dataset ds: An open netCDF dataset
          '''
  
          if not (hasattr(ds, 'geospatial_lat_min') or hasattr(ds, 'geospatial_lat_max')):
              return Result(BaseCheck.MEDIUM,
                            False,
                            'geospatial_lat_extents_match',
                            ['geospatial_lat_min/max attribute not found, CF-1.6 spec chapter 4.1'])
  
          try: # type cast
              lat_min = float(ds.geospatial_lat_min)
              lat_max = float(ds.geospatial_lat_max)
          except ValueError:
              return Result(BaseCheck.MEDIUM,
                            False,
                            'geospatial_lat_extents_match',
                            ['Could not convert one of geospatial_lat_min ({}) or max ({}) to float see CF-1.6 spec chapter 4.1'
                            ''.format(ds.geospatial_lat_min, ds.geospatial_lat_max)])
  
  
          # identify lat var(s) as per CF 4.1
          lat_vars = {}       # var -> number of criteria passed
          for name, var in ds.variables.items():
  
              # must have units
              if not hasattr(var, 'units'):
                  continue
  
              lat_vars[var] = 0
  
              # units in this set
              if var.units in _possibleyunits:
                  lat_vars[var] += 1
  
              # standard name of "latitude"
              if hasattr(var, 'standard_name') and var.standard_name == 'latitude':
                  lat_vars[var] += 1
  
              # axis of "Y"
              if hasattr(var, 'axis') and var.axis == 'Y':
                  lat_vars[var] += 1
  
          # trim out any zeros
          lat_vars = {k: v for k, v in lat_vars.items() if v > 0}
  
          if len(lat_vars) == 0:
              return Result(BaseCheck.MEDIUM,
                            False,
                            'geospatial_lat_extents_match',
                            ['Could not find lat variable to test extent of geospatial_lat_min/max, see CF-1.6 spec chapter 4.1'])
  
          # sort by criteria passed
          final_lats = sorted(lat_vars, key=lambda x: lat_vars[x], reverse=True)
  
          obs_mins = {var._name: np.nanmin(var) for var in final_lats if not np.isnan(var).all()}
          obs_maxs = {var._name: np.nanmax(var) for var in final_lats if not np.isnan(var).all()}
  
          min_pass = any((np.isclose(lat_min, min_val) for min_val in obs_mins.values()))
          max_pass = any((np.isclose(lat_max, max_val) for max_val in obs_maxs.values()))
  
          allpass = sum((min_pass, max_pass))
  
          msgs = []
          if not min_pass:
              msgs.append("Data for possible latitude variables (%s) did not match geospatial_lat_min value (%s)" % (obs_mins, lat_min))
          if not max_pass:
              msgs.append("Data for possible latitude variables (%s) did not match geospatial_lat_max value (%s)" % (obs_maxs, lat_max))
  
          return Result(BaseCheck.MEDIUM,
                        (allpass, 2),
                        'geospatial_lat_extents_match',
                        msgs)