BPt.Duplicate#

class BPt.Duplicate(iterable=(), /)[source]#

The Duplicate object is an BPt specific Input wrapper. It is designed to be cast on a list of valid scope parameters, e.g.,

scope = Duplicate(['float', 'cat'])

Such that the corresponding pipeline piece will be duplicated for every entry within Duplicate. In this case, two copies of the base object will be made, where both have the same remaining non-scope params (i.e., obj, params, extra_params), but one will have a scope of ‘float’ and the other ‘cat’.

Consider the following extended example, where loaders is being specified when creating an instance of Pipeline:

loaders = Loader(obj='identity', scope=Duplicate(['float', 'cat']))

Is transformed in post processing / equivalent to

loaders = [Loader(obj='identity', scope='float'),
           Loader(obj='identity', scope='cat')]

Methods

append(object, /)

Append object to the end of the list.

clear(/)

Remove all items from list.

copy(/)

Return a shallow copy of the list.

count(value, /)

Return number of occurrences of value.

extend(iterable, /)

Extend list by appending elements from the iterable.

index(value[, start, stop])

Return first index of value.

insert(index, object, /)

Insert object before index.

pop([index])

Remove and return item at index (default last).

remove(value, /)

Remove first occurrence of value.

reverse(/)

Reverse IN PLACE.

sort(*[, key, reverse])

Sort the list in ascending order and return None.