LabelMapper

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

Bases: _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:
mapperModel

A function which returns a region.

no_labelstr or int

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

inputs_mappingMapping 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.

namestr

The name of this transform.

Attributes Summary

inputs

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

inputs_mapping

mapper

n_inputs

n_outputs

The number of outputs.

no_label

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
n_inputs

The number of inputs.

n_outputs = 1

The number of outputs.

no_label

Methods Documentation

evaluate(*args)[source]

Evaluate the model on some input variables.