"""
Testing of SED-ML data support, i.e., DataDescription.
"""
from __future__ import print_function, absolute_import

import os
import pytest
import matplotlib

from tellurium.tests.testdata import TESTDATA_DIR

from tellurium.sedml.data import DataDescriptionParser
from tellurium.sedml.tesedml import SEDMLTools

try:
    import libsedml
except ImportError:
    import tesedml as libsedml

from tellurium.sedml import tesedml

# ---------------------------------------------------------------------------------
BASE_DIR = os.path.join(TESTDATA_DIR, 'sedml', 'data')

SOURCE_CSV = os.path.join(BASE_DIR, "oscli.csv")
SOURCE_TSV = os.path.join(BASE_DIR, "oscli.tsv")
SOURCE_NUML = os.path.join(BASE_DIR, "./oscli.xml")
SOURCE_NUML_1D = os.path.join(BASE_DIR, "./numlData1D.xml")
SOURCE_NUML_2D = os.path.join(BASE_DIR, "./numlData2D.xml")
SOURCE_NUML_2DRC = os.path.join(BASE_DIR, "./numlData2DRC.xml")

SEDML_READ_CSV = os.path.join(BASE_DIR, "reading-oscli-csv.xml")
SEDML_READ_TSV = os.path.join(BASE_DIR, "reading-oscli-tsv.xml")
SEDML_READ_NUML = os.path.join(BASE_DIR, "reading-oscli-numl.xml")
SEDML_READ_NUML_1D = os.path.join(BASE_DIR, "reading-numlData1D.xml")
SEDML_READ_NUML_2D = os.path.join(BASE_DIR, "reading-numlData2D.xml")
SEDML_READ_NUML_2DRC = os.path.join(BASE_DIR, "reading-numlData2DRC.xml")

OMEX_PLOT_CSV = os.path.join(BASE_DIR, 'omex', "plot_csv.omex")
OMEX_PLOT_CSV_WITH_MODEL = os.path.join(BASE_DIR, 'omex', "plot_csv_with_model.omex")
OMEX_PLOT_NUML = os.path.join(BASE_DIR, 'omex', "plot_numl.omex")
OMEX_PLOT_NUML_WITH_MODEL = os.path.join(BASE_DIR, 'omex', "plot_numl_with_model.omex")

SOURCE_CSV_PARAMETERS = os.path.join(BASE_DIR, "parameters.csv")
SEDML_CSV_PARAMETERS = os.path.join(BASE_DIR, "parameter-from-data-csv.xml")
OMEX_CSV_PARAMETERS = os.path.join(BASE_DIR, 'omex', "parameter_from_data_csv.omex")

OMEX_CSV_JWS_ADLUNG2017_FIG2G = os.path.join(BASE_DIR, 'omex', "jws_adlung2017_fig2g.omex")


# ---------------------------------------------------------------------------------
MPL_BACKEND = None


def setup_module(module):
    """ setup any state specific to the execution of the given module."""
    global MPL_BACKEND