# -*- coding: utf-8 -*-
# Project: Utsusemi HPN extension
# Module:  HPN.ana.Reducton.Commands
from __future__ import print_function
import os
import Manyo


def SaveDataToText(ec, path="./", filename="sample.txt"):
    """
    Save ElementContainer to text file.
    @param  dat      (ElementContainerMatrix)
    @param  path     (String) path to data file
    @param  filename (String) text file name
    @retval None
    """
    if not isinstance(ec, Manyo.ElementContainer):
        raise UserWarining(
            "Arg1 must be ElementContainer, not '%s'." % ec.__class__.__name__)

    print("Output ec to text...")
    ec.SaveTextFile(os.path.join(path, filename))
