Pipe

Inheritance diagram of naming.Pipe

class naming.Pipe(name='', sep=' ')[source]

Inherited by: naming.PipeFile

Pipeline names have a field pipe which is composed of distinctive elements that make a resource unique.

Field

Characters

Description

version

One or more digits

Required field that helps track important states of a pipeline resource during its lifecycle.

This allows for history revision, rollbacks and comparisons.

output

One or more word characters

Optional field used when the produced data can be separated into meaningful distinct streams, e.g:

  • Left or right channel of a track.

  • Beauty, specular, diffuse render passes.

  • Body, eyes, hair textures.

index

One or more digits

Position of an element within the pipeline resource when it is a sequence, e.g:

  • A frame of a rendered shot.

  • UDIM textures.

  • Chunks of a cache.

If used, the output field must also exist. This is to prevent ambiguity when solving the fields.

Composed Fields

pipe

Combination of unique fields in the form of: (.{output})*.{version}.{index}**

* optional field. ** exists only when output is there as well.

Example:
>>> from naming import Pipe
>>> class MyPipe(Pipe):
...     config = dict(base=r'\w+')
...
>>> p = MyPipe()
>>> p.get()
'{base}.{pipe}'
>>> p.get(version=10)
'{base}.10'
>>> p.get(output='data')
'{base}.data.{version}'
>>> p.get(output='cache', version=7, index=24)
'{base}.cache.7.24'
>>> p = MyPipe('my_wip_data.1')
>>> p.version
'1'
>>> p.values
{'base': 'my_wip_data', 'pipe': '.1', 'version': '1'}
>>> p.get(output='exchange')  # returns a new string
'my_wip_data.exchange.1'
>>> p.name
'my_wip_data.1'
>>> p.output = 'exchange'  # mutates the object
>>> p.name
'my_wip_data.exchange.1'
>>> p.index = 101
>>> p.version = 7
>>> p.name
'my_wip_data.exchange.7.101'
>>> p.values
{'base': 'my_wip_data', 'pipe': '.exchange.7.101', 'output': 'exchange', 'version': '7', 'index': '101'}
Parameters:
  • name (str) –

  • sep (str) –