class_docstr: Test netCDF compression encodings.
docstr: Get encoding.
docstr_tok: ["Get","encoding","."]
code: def encoding(self, compression_on):
      """Get encoding."""
      enc = {
          "test-array": {
              "dtype": "int8",
              "scale_factor": 0.1,
              "add_offset": 0.0,
              "_FillValue": 3,
          }
      }
      if compression_on:
          comp_params = _get_compression_params(complevel=7)
          enc["test-array"].update(comp_params)
      return enc
  
imports: import os
  import tempfile
  import warnings
  from datetime import datetime
  import numpy
  import pytest
  import xarray
  from packaging.version import Version
  from satpy import Scene
  from satpy.tests.utils import make_dsq
  from satpy.writers.cf_writer import _get_backend_versions
label_desc: Use image node_id 3 for calling the TestNetcdfEncodingKwargs obj's underlying member method code with example usage: obj.encoding(compression_on) and returns: enc