class_docstr: Interface for implementing axis transformations.
  
  Instances hold implementations of transformations to and from axis space.
  The default implementation is equivalent to:
  
  >>> def forward_transform(data_x):
  ...     scale * mapper(data_x) + t
  >>> def inverse_transform(axis_x):
  ...     inverse_mapper((axis_x - t)/s)
  
  Where ``mapper`` and ``inverse_mapper`` are elementwise functions mapping
  to and from axis-space respectively, and ``scale`` and ``transform`` are
  parameters describing a linear scale and translate transformation, computed
  by the ``compute_scale_and_translate`` method.
class_docstr_tok: ["Interface","for","implementing","axis","transformations",".","Instances","hold","implementations","of","transformations","to","and","from","axis","space",".","The","default","implementation","is","equivalent","to",":",">",">",">","def","forward_transform","(","data_x",")",":","...","scale","*","mapper","(","data_x",")","+","t",">",">",">","def","inverse_transform","(","axis_x",")",":","...","inverse_mapper","(","(","axis_x","-","t",")","\/s",")","Where","``","mapper","``","and","``","inverse_mapper","``","are","elementwise","functions","mapping","to","and","from","axis-space","respectively",",","and","``","scale","``","and","``","transform","``","are","parameters","describing","a","linear","scale","and","translate","transformation",",","computed","by","the","``","compute_scale_and_translate","``","method","."]
docstr: Compute a 1D array representing the axis index.
  
  Parameters
  ----------
  st : tuple
      A tuple of ``(scale, translate)`` parameters.
  n : int
      The number of bins along the dimension.
  
  Returns
  -------
  index : ndarray
docstr_tok: ["Compute","a","1D","array","representing","the","axis","index",".","Parameters","--","--","--","--","--","st",":","tuple","A","tuple","of","``","(","scale",",","translate",")","``","parameters",".","n",":","int","The","number","of","bins","along","the","dimension",".","Returns","--","--","--","-","index",":","ndarray"]
code: def compute_index(self, st, n):
      """Compute a 1D array representing the axis index.
  
      Parameters
      ----------
      st : tuple
          A tuple of ``(scale, translate)`` parameters.
      n : int
          The number of bins along the dimension.
  
      Returns
      -------
      index : ndarray
      """
      px = np.arange(n) + 0.5
      s, t = st
      return self.inverse_mapper((px - t) / s)
  
imports: from __future__ import annotations
  from numbers import Number
  from math import log10
  import warnings
  import numpy
  import pandas
  import dask.dataframe
  import dask.array
  from xarray import DataArray, Dataset
  from .utils import Dispatcher, ngjit, calc_res, calc_bbox, orient_array, dshape_from_xarray_dataset
  from .utils import get_indices, dshape_from_pandas, dshape_from_dask
  from .utils import Expr
  from .resampling import resample_2d, resample_2d_distributed
  from .None import reductions
label_desc: Use image node_id 2 for calling the Axis obj's underlying member method code with example usage: obj.compute_index(st, n) and returns: self