rztdl.utils package

Submodules

rztdl.utils.async_util module

@created on: 02/01/20,
@author: Umesh Kumar,
@version: v0.0.1

Description:

Sphinx Documentation Status: Complete

rztdl.utils.async_util.async_method(f=None, callback=None)[source]
@author: Umesh Kumar

Custom Exception Decorator.
Parameters:
  • f – Function
  • callback – Callaback Function

rztdl.utils.blueprint module

@created on: 21/01/20,
@author: Umesh Kumar,
@version: v0.0.1

Description:

Sphinx Documentation Status: Complete

class rztdl.utils.blueprint.BluePrintProperties(name: str, data_type: typing.Union[str, NoneType], description: str, label: str = '', optional: bool = False, repeatable: bool = False, link_to_attribute: str = None, minimum_inputs: int = None, default_value=None, possible_values=None, minimum_outputs: int = None, table_meta: dict = None, properties: list = None, class_name=None, minimum_items: int = None, maximum_items: int = None, multiple_output: bool = False)[source]

Bases: object

Parameters:
  • name (str) – Name of the property
  • label (str) – Label
  • data_type (Optional[str]) – Datatype of the property
  • optional (bool) – Whether Parameter is optional or not
  • repeatable (bool) – Whether Parameter is repeatable or not
  • description (str) – Description of the property
  • default_value – Default value of the property
  • possible_values – List of possible values (only if data_type is List)
  • link_to_attribute (Optional[str]) – If property is linked to some other attribute
  • minimum_inputs (Optional[int]) – Minimum input dents to show when input is repeatable
  • minimum_outputs (Optional[int]) – Minimum Output dents to show when output is repeatable
  • properties (Optional[list]) – List of BlueprintProperties (only if data_type is complex)
  • class_name – Class name
  • minimum_items (Optional[int]) – Minimum items for Matrix Render type
  • maximum_items (Optional[int]) – Maximum items for Matrix Render type
  • table_meta (Optional[dict]) – Table meta for Confusion Matrix
  • multiple_output (bool) – Whether multiple connections can drag from same output dent (for fork operator)
json()[source]
validate()[source]
class rztdl.utils.blueprint.Blueprint(cls: typing.Union[type, str], description: str = '', version: str = '3.0.0', label: str = '', support_transfer_weights=False)[source]

Bases: object

add_inputs(name, data_type, description, label='', minimum_inputs=None, minimum_items=None, maximum_items=None, optional=True, repeatable=False, link_to_attribute=None, properties=None, default_value=None, class_name=None, minimum_outputs=None)[source]
add_outputs(name, data_type, description, label='', minimum_inputs=None, minimum_items=None, maximum_items=None, optional=True, repeatable=False, link_to_attribute=None, properties=None, default_value=None, multiple_output=True, class_name=None, minimum_outputs=None)[source]
add_parameter(name, data_type, description, minimum_inputs=None, label='', minimum_outputs=None, optional=True, repeatable=False, link_to_attribute=None, minimum_items=None, maximum_items=None, properties=None, default_value=None, class_name=None, possible_values=None)[source]
get_nth_depth_parameter(parameters, total_depth, current_depth, split_parameters)[source]
Parameters:
  • split_parameters (list) –
  • parameters (list) –
  • total_depth (int) –
  • current_depth (int) –
Returns:

get_parameter(name)[source]
get_parameters(include=(), exclude=(), **kwargs)[source]
get_type_of_class(cls)[source]
inputs
outputs
parameters
remove_parameter_by_name(name)[source]
to_json()[source]
rztdl.utils.blueprint.generate_bp_properites(cls)[source]
rztdl.utils.blueprint.get_component_blueprint(cls)[source]
rztdl.utils.blueprint.get_helpers_blueprint(cls)[source]

rztdl.utils.exceptions module

@created on: 12/26/19, @author: Himaprasoon, @version: v0.0.1

Description:

Sphinx Documentation Status:

exception rztdl.utils.exceptions.ComponentException(component_name: str, message: str, errors=None)[source]

Bases: rztdl.utils.exceptions.RztdlException

@author: Prathyush SP

Component Exception.
Parameters:
  • component_name (str) – Component Name
  • message (str) – Error Message
  • errors – Errors
exception rztdl.utils.exceptions.DatasetException(dataset_name: str, message: str, errors=None)[source]

Bases: rztdl.utils.exceptions.RztdlException

@author: Himaprasoon

Exception caused due to Insufficient data fed to placeholders
Parameters:
  • entity_name – Component Name
  • message (str) – Error Message
  • errors – Errors
exception rztdl.utils.exceptions.DatasetHandlerException(name: str, message: str, errors=None)[source]

Bases: rztdl.utils.exceptions.RztdlException

@author: Himaprasoon PT

Exception caused in DatasetHandler
Parameters:
  • name (str) – Handler Name
  • message (str) – Error Message
  • errors – Errors
exception rztdl.utils.exceptions.DatasetSplitException(split_name: str, message: str, errors=None)[source]

Bases: rztdl.utils.exceptions.RztdlException

@author: Himaprasoon PT

Exception caused in SpLits
Parameters:
  • split_name (str) – Component Name
  • message (str) – Error Message
  • errors – Errors
exception rztdl.utils.exceptions.DimensionError(entity_name: str, message: str, errors=None)[source]

Bases: rztdl.utils.exceptions.RztdlException

@author: Prathyush SP

Dimension Error
Parameters:
  • entity_name (str) – Component Name
  • message (str) – Error Message
  • errors – Errors
exception rztdl.utils.exceptions.FlowException(flow_name: str, message: str, errors=None)[source]

Bases: rztdl.utils.exceptions.RztdlException

Parameters:
  • flow_name (str) – Component Name
  • message (str) – Error Message
  • errors – Errors
exception rztdl.utils.exceptions.KafkaDataFormatException(entity_name: str, message: str, errors=None)[source]

Bases: rztdl.utils.exceptions.KafkaException

@author: Himaprasoon PT

Kafka dataformat Exception
Parameters:
  • entity_name (str) – Component Name
  • message (str) – Error Message
  • errors – Errors
exception rztdl.utils.exceptions.KafkaException(entity_name: str, message: str, errors=None)[source]

Bases: rztdl.utils.exceptions.RztdlException

@author: Himaprasoon PT

Exception in Kafka
Parameters:
  • entity_name (str) – Component Name
  • message (str) – Error Message
  • errors – Errors
exception rztdl.utils.exceptions.RztdlException(entity_name: str, message: str, errors, exception: str = None)[source]

Bases: Exception

exception rztdl.utils.exceptions.SizeError(entity_name: str, message: str, errors=None)[source]

Bases: rztdl.utils.exceptions.RztdlException

@author: Prathyush SP

Size Validation.
Parameters:
  • entity_name (str) – Component Name
  • message (str) – Error Message
  • errors – Errors
exception rztdl.utils.exceptions.SplitHandlerException(name: str, message: str, errors=None)[source]

Bases: rztdl.utils.exceptions.RztdlException

@author: Himaprasoon PT

Exception caused in SpLits
Parameters:
  • name (str) – Component Name
  • message (str) – Error Message
  • errors – Errors

rztdl.utils.file_operations module

@created on: 22/01/20,
@author: Umesh Kumar,
@version: v0.0.1

Description:

Sphinx Documentation Status: Complete

class rztdl.utils.file_operations.File[source]

Bases: object

@author: Umesh Kumar

File Utilities
static is_exist()[source]
@author: Umesh Kumar

Check if a file exists
Parameters:path (str) – File Path
Return type:bool
Returns:Boolean
static is_readable()[source]
@author: Umesh Kumar

Check if the directory is readable
Parameters:path (str) – Directory path
Return type:bool
Returns:Bool
static is_writable()[source]
@author: Umesh Kumar

Check if the directory is writable
Parameters:path – Directory path
Return type:bool
Returns:Bool
static line_count(encoding=None)[source]
@author: Umesh Kumar

Count the number of lines in a File
Parameters:
  • path (str) – File Path
  • encoding (Optional[str]) – File Encoding
Return type:

int

Returns:

Line Count in int

static load_json(file_name, encoding=None, mode='r', load_format=<class 'dict'>)[source]
@author: Umesh Kumar

Added Load JSON method
Parameters:
  • load_path (str) – Load Path
  • file_name (str) – File Name
  • encoding (Optional[str]) – Encoding
  • mode (str) – Mode - ‘r / rb’
  • load_format
    • Object Pair Hooks for JSON
Returns:

load_format object

static read_json(encoding=None, object_pairs_hook=<class 'dict'>)[source]
@author: Umesh Kumar

Load JSON (dict) from a file
Parameters:
  • object_pairs_hook (dict) –
  • path (str) – File Path
  • encoding (Optional[str]) – File Encoding
Return type:

Union[int, dict]

Returns:

Dictionary

static size()[source]
@author: Umesh Kumar

Get File Size
Parameters:path (str) – File Path
Return type:int
Returns:File Size
static word_count(encoding=None, only_count=True)[source]
@author: Umesh Kumar

Count the number of words in a File
Parameters:
  • path (str) – File Path
  • encoding (Optional[str]) – File Encoding
  • only_count – True/False [Count / {Word: Count}]
Return type:

Union[int, Counter]

Returns:

Union[int, Counter]

static write_json(save_path, file_name, encoding=None, sort=False, reverse=False, indent=2, parent_key=None)[source]
@author: Umesh Kumar

Write JSON to a File
Parameters:
  • data (Dict[~KT, ~VT]) – JSON Data
  • save_path (str) – Save Path
  • file_name (str) – File Name
  • encoding (Optional[str]) – File Encoding
  • sort – Sort JSON based on key in ascending order
  • reverse – Sort JSON based on key in descending order
  • indent – JSON Indentation
  • parent_key (Optional[str]) – Parent Key

rztdl.utils.py_utils module

@created on: 12/13/19, @author: Himaprasoon, @version: v0.0.1

Description:

Sphinx Documentation Status:

class rztdl.utils.py_utils.AutoNameEnum[source]

Bases: enum.Enum

An enumeration.

classmethod blueprint()[source]
class rztdl.utils.py_utils.RejectingDict(prefix='Key')[source]

Bases: dict

rztdl.utils.py_utils.get_mnist_data_func(max_read_lines, eye=False)[source]
rztdl.utils.py_utils.inputs_shape_checker(func)[source]

Vivek A Gupta

Parameters:func – Checks for mismatch in shape for predictions and labels
Returns:
rztdl.utils.py_utils.launch_tensorboard(logdir, clear_on_exit=True)[source]
rztdl.utils.py_utils.partition(partition_function, iterable)[source]

Partitions and Iterable into two based on a partition_function. If partition_func(item) is true / false :param partition_function: function applied on each item in iterable :param iterable: :return:

rztdl.utils.py_utils.raise_component_exception(func)[source]
rztdl.utils.py_utils.raise_flow_exception(func)[source]
rztdl.utils.py_utils.run_system_command(command)[source]
@author: Prathyush SP

Run System Command
Parameters:command (str) – Command in string
Returns:Process info , return code
rztdl.utils.py_utils.validate_name(name)[source]
@author: Prathyush SP

Name Validation
Parameters:name (str) – Name
Return type:str
Returns:String

rztdl.utils.transfer_learning_utils module

class rztdl.utils.transfer_learning_utils.NumpyWeightLoader[source]

Bases: object

static get_variable_shape_map()[source]
static load_weight(variable_name=None)[source]
static load_weights(variable_names=None)[source]

Module contents

@created on: 12/13/19, @author: Himaprasoon, @version: v0.0.1

Description:

Sphinx Documentation Status: