class_docstr: Main test class for the LI L2 reader.
class_docstr_tok: ["Main","test","class","for","the","LI","L2","reader","."]
docstr: Test automatic rescaling with offset and scale attributes.
docstr_tok: ["Test","automatic","rescaling","with","offset","and","scale","attributes","."]
code: def test_variable_scaling(self, filetype_infos):
      """Test automatic rescaling with offset and scale attributes."""
      filename_info = {
          "start_time": "20101112131415",
          "end_time": "20101112131416",
      }
  
      handler = LIL2NCFileHandler(
          "filename",
          filename_info,
          extract_filetype_info(filetype_infos, "li_l2_lfl_nc"),
      )
  
      # Get the raw variable without rescaling:
      vname = "latitude"
      rawlat = handler.get_measured_variable(vname)
  
      # Get the dataset without rescaling:
      dataset_info = {
          "name": vname,
          "variable_name": vname,
          "use_rescaling": False,
      }
  
      dataset_id = make_dataid(name=vname)
      lat_noscale = handler.get_dataset(dataset_id, dataset_info)
      assert np.all(lat_noscale.values == rawlat)
  
      # Now get the dataset with scaling:
      dataset_info["use_rescaling"] = True
      lat_scaled = handler.get_dataset(dataset_id, dataset_info)
  
      # By default we write data in the ranges [-88.3/0.0027, 88.3/0.0027] for latitude and longitude:
      assert abs(np.nanmax(lat_scaled.values) - 88.3) < 1e-2
      assert abs(np.nanmin(lat_scaled.values) + 88.3) < 1e-2
  
imports: import os
  from datetime import datetime
  from unittest import mock
  import numpy
  import pytest
  import xarray
  from pyproj import Proj
  from satpy._config import config_search_paths
  from satpy.readers.li_base_nc import LINCFileHandler
  from satpy.readers.li_l2_nc import LI_GRID_SHAPE, LIL2NCFileHandler
  from satpy.readers.yaml_reader import load_yaml_configs
  from satpy.tests.reader_tests._li_test_utils import FakeLIFileHandlerBase, extract_filetype_info, get_product_schema, products_dict
  from satpy.tests.utils import make_dataid
label_desc: Use image node_id 17 for calling the TestLIL2 obj's underlying member method code with example usage: obj.test_variable_scaling(filetype_infos) without return types