Example #1
0
    def test_setup_logging(self):
        """ Test setup_logging function. """
        self.assertIsInstance(my_logger.setup_logging('test_logger'), Logger)

        logging_error_file = os.path.abspath(
            os.path.join(my_files.ROOT_PROJECT_DIRECTORY, 'tests', 'utils',
                         'logging_error.yaml'))
        my_logger.setup_logging('test_logger', logging_error_file)
Example #2
0
"""
    Author: André Bento
    Date last modified: 08-04-2019
"""
from collections import defaultdict

import networkx as nx

from graphy.utils import dict as my_dict
from graphy.utils import list as my_list
from graphy.utils import logger as my_logger

logger = my_logger.setup_logging(__name__)


class GraphProcessor:
    """ GraphProcessor contains a collection of methods to handle Graphs. """

    def __init__(self):
        """ Initiate a new GraphProcessor. """
        self.__graph = nx.MultiDiGraph()

        self.__start_timestamp = None
        self.__end_timestamp = None

        self.span_tree = None

    @property
    def graph(self):
        return self.__graph