LabelMapper

class gwcs.selector.LabelMapper(inputs, mapper, no_label=nan, inputs_mapping=None, name=None, **kwargs)[source]

Bases: gwcs.selector._LabelMapper

Maps inputs to regions. Returns the region labels corresponding to the inputs.

Labels are strings or numbers which uniquely identify a location. For example, labels may represent slices of an IFU or names of spherical polygons.

Parameters:
mapper : Model

A function which returns a region.

no_label : str or int

“” or 0 A return value for a location which has no corresponding label.

inputs_mapping : Mapping or tuple

An optional Mapping model to be prepended to the LabelMapper with the purpose to filter the inputs or change their order. If tuple, a Mapping model will be created from it.

name : str

The name of this transform.

Attributes Summary

inputsThe name(s) of the input variable(s) on which a model is evaluated.inputs_mappingmapperno_labeloutputs

Methods Summary

evaluate(*args)Evaluate the model on some input variables.

Attributes Documentation

inputs

The name(s) of the input variable(s) on which a model is evaluated.

inputs_mapping
mapper
no_label
outputs = ('label',)

Methods Documentation

evaluate(*args)[source]

Evaluate the model on some input variables.