fito.operations package

Submodules

fito.operations.decorate module

fito.operations.decorate.GenericDecorator[source]

Abstracts all the boilerplate required to build a decorator that works on functions, instance methods and class methods

Parameters:method_type – if is None, the decorated function is assumed to be a function, otherwise it is assumed to be a method. If method_type == ‘instance’ the function is assumed to be an instance method otherwise a classmethod
fito.operations.decorate.as_operation[source]

Creates an operation from a callable :param out_type: Base class of the operation to be built. Defaults to Operation :param out_name: Name of the class to be built, deafults to the decorated function name.

fito.operations.decorate.get_default_values(f_spec)[source]

Returns a mapping from a function spec (output of inspect.getargspec)

fito.operations.decorate.operation_from_func(to_wrap, func_to_execute, out_type, out_name, args_specifications, f_spec=None, method_type=None, first_arg=None, cache_on=None)[source]

In the case of methods, to_wrap is not the same to func_to_execute :param to_wrap: See GenericDecorator.create_decorated for an explanation :param func_to_execute: See GenericDecorator.create_decorated for an explanation :param cache_on: A data store onto which the operation should be cached :return:

fito.operations.decorate.print_fields_from_func(callable)[source]

fito.operations.dependencies module

class fito.operations.dependencies.DependencyGraph[source]

Bases: object

Main class to both manipulate the graph and inherit to get cool graph powers

static add_dependency(source, target)[source]

Source depends on target :return:

dependency_graph = {}
static get_dependency_clausure(*classes_or_instances, **kwargs)[source]
static get_dependency_graph()[source]

Converts this guy to a networkx graph to easily perform crazy computations with this graph :return:

static get_direct_dependencies(klass)[source]
static has_dependencies(klass)[source]
fito.operations.dependencies.depends_on(thing)[source]

Main decorator to tie things together :param thing: What you wanna tie with see pipeline.py or english_proficiency.py for examples

fito.operations.dependencies.get_subclasses(cls)[source]

fito.operations.operation module

class fito.operations.operation.MemoryObject(*args, **kwargs)[source]

Bases: fito.operations.operation.Operation

MemoryObject fields:
obj = PrimitiveField(0) out_data_store = BaseSpecField(default=None, serialize=False)
apply(runner)[source]
obj = PrimitiveField(0)
to_dict(include_all=False)[source]
class fito.operations.operation.Operation(*args, **kwargs)[source]

Bases: fito.specs.base.Spec

Operation fields:
out_data_store = BaseSpecField(default=None, serialize=False)
apply(runner)[source]
default_data_store = None
execute(force=False)[source]
get_out_data_store()[source]
out_data_store = BaseSpecField(default=None, serialize=False)
fito.operations.operation.OperationField(pos=None, default=<object object>, base_type=None)[source]

fito.operations.series module

Module contents