labels¶
- LabelMixin.labels(pores=[], throats=[], element=None, mode='union')[source]¶
Returns a list of labels present on the object
Additionally, this function can return labels applied to a specified set of pores or throats
- Parameters
element (str) – Controls whether pore or throat labels are returned. If empty then both are returned (default).
throats) (pores (or) – The pores (or throats) whose labels are sought. If left empty a list containing all pore and throat labels is returned.
mode (str, optional) –
Controls how the query should be performed. Only applicable when
pores
orthroats
are specified:’or’, ‘union’, ‘any’: (default) Returns the labels that are assigned to any of the given locations.
’and’, ‘intersection’, ‘all’: Labels that are present on all the given locations.
’xor’, ‘exclusive_or’ : Labels that are present on only one of the given locations.
’nor’, ‘none’, ‘not’: Labels that are not present on any of the given locations.
’nand’: Labels that are present on all but one of the given locations
’xnor’: Labels that are present on more than one of the given locations. ‘nxor’ is also accepted.
- Returns
A list containing the labels on the object. If
pores
orthroats
are given, the results are filtered according to thespecified
mode
.
See also
props
,keys
Notes
Technically, ‘nand’ and ‘xnor’ should also return pores with none of the labels but these are not included. This makes the returned list more useful.
Examples
>>> import openpnm as op >>> pn = op.network.Cubic(shape=[5, 5, 5]) >>> pn.labels(pores=[11, 12]) ['pore.all', 'pore.internal', 'pore.left', 'pore.surface']