mltrace.entities package

Submodules

mltrace.entities.base module

class mltrace.entities.base.Base[source]

Bases: abc.ABC

The Base class provides methods to save and store attributes as well as print them out.

classmethod from_dictionary(d)[source]
to_dictionary()[source]

mltrace.entities.component module

class mltrace.entities.component.Component(name: str, description: str, owner: str, tags: List[str] = [])[source]

Bases: mltrace.entities.base.Base

Component abstraction.

property description
property name
property owner
property tags

mltrace.entities.component_run module

class mltrace.entities.component_run.ComponentRun(component_name: str, notes: str = '', start_timestamp: Optional[datetime.datetime] = None, end_timestamp: Optional[datetime.datetime] = None, inputs: List[mltrace.entities.io_pointer.IOPointer] = [], outputs: List[mltrace.entities.io_pointer.IOPointer] = [], git_hash: Optional[str] = None, git_tags: List[str] = [], code_snapshot: Optional[str] = None, id: Optional[str] = None, stale: List[str] = [], dependencies: List[str] = [])[source]

Bases: mltrace.entities.base.Base

Component Run abstraction.

add_input(inp: Union[str, mltrace.entities.io_pointer.IOPointer], pointer_type: Optional[mltrace.db.models.PointerTypeEnum] = None)[source]

Add a single input (instance of IOPointer).

add_inputs(inputs: List[Union[str, mltrace.entities.io_pointer.IOPointer]])[source]

Add a list of inputs (each element should be an instance of IOPointer).

add_output(out: Union[str, mltrace.entities.io_pointer.IOPointer], pointer_type: Optional[mltrace.db.models.PointerTypeEnum] = None)[source]

“Add a single output (instance of IOPointer).

add_outputs(outputs: List[Union[str, mltrace.entities.io_pointer.IOPointer]])[source]

Add a list of outputs (each element should be an instance of IOPointer).

property code_snapshot
property component_name
property dependencies
property end_timestamp
property git_hash
property git_tags
property id
property inputs
property notes
property outputs
set_end_timestamp(ts: Optional[datetime.datetime] = None)[source]
set_start_timestamp(ts: Optional[datetime.datetime] = None)[source]
set_upstream(dependencies: Union[str, List[str]])[source]

Set dependencies for this ComponentRun. API similar to Airflow set_upstream. It will grab the most recent run for the dependency name.

property stale
property start_timestamp
mltrace.entities.component_run.get_timestamp()int[source]

Returns current timestamp as seconds since epoch.

mltrace.entities.io_pointer module

class mltrace.entities.io_pointer.IOPointer(name: str, pointer_type: mltrace.db.models.PointerTypeEnum = <PointerTypeEnum.UNKNOWN: 'UNKNOWN'>, flag: bool = False)[source]

Bases: mltrace.entities.base.Base

property flag
property name
property pointer_type

Module contents

class mltrace.entities.Component(name: str, description: str, owner: str, tags: List[str] = [])[source]

Bases: mltrace.entities.base.Base

Component abstraction.

property description
property name
property owner
property tags
class mltrace.entities.ComponentRun(component_name: str, notes: str = '', start_timestamp: Optional[datetime.datetime] = None, end_timestamp: Optional[datetime.datetime] = None, inputs: List[mltrace.entities.io_pointer.IOPointer] = [], outputs: List[mltrace.entities.io_pointer.IOPointer] = [], git_hash: Optional[str] = None, git_tags: List[str] = [], code_snapshot: Optional[str] = None, id: Optional[str] = None, stale: List[str] = [], dependencies: List[str] = [])[source]

Bases: mltrace.entities.base.Base

Component Run abstraction.

add_input(inp: Union[str, mltrace.entities.io_pointer.IOPointer], pointer_type: Optional[mltrace.db.models.PointerTypeEnum] = None)[source]

Add a single input (instance of IOPointer).

add_inputs(inputs: List[Union[str, mltrace.entities.io_pointer.IOPointer]])[source]

Add a list of inputs (each element should be an instance of IOPointer).

add_output(out: Union[str, mltrace.entities.io_pointer.IOPointer], pointer_type: Optional[mltrace.db.models.PointerTypeEnum] = None)[source]

“Add a single output (instance of IOPointer).

add_outputs(outputs: List[Union[str, mltrace.entities.io_pointer.IOPointer]])[source]

Add a list of outputs (each element should be an instance of IOPointer).

property code_snapshot
property component_name
property dependencies
property end_timestamp
property git_hash
property git_tags
property id
property inputs
property notes
property outputs
set_end_timestamp(ts: Optional[datetime.datetime] = None)[source]
set_start_timestamp(ts: Optional[datetime.datetime] = None)[source]
set_upstream(dependencies: Union[str, List[str]])[source]

Set dependencies for this ComponentRun. API similar to Airflow set_upstream. It will grab the most recent run for the dependency name.

property stale
property start_timestamp
class mltrace.entities.IOPointer(name: str, pointer_type: mltrace.db.models.PointerTypeEnum = <PointerTypeEnum.UNKNOWN: 'UNKNOWN'>, flag: bool = False)[source]

Bases: mltrace.entities.base.Base

property flag
property name
property pointer_type