__init__.py 3.67 KB
Newer Older
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# ================= FILE HEADER ========================================
#
#   myplotlib v0.0.0,
#
#   @file      __init__.py
#   @author    Yori 'AGy' Fournier
#   @licence   CC-BY-SA
#
#   Import and Configuration file for myplotlib
#
#   @section Import
#
#   myplotlib is base on matplotlib therefore it requires
#   Figure and Axes as main classes and a few further functions.
#
#   @section Config
#
#   Default value for user parameters
#   and configuration for the default plotting
#
#   @section Module Import
#
#   Import of myplotlib classes and function
#
#   @section History
#
#   v 0.0.0 - __init__.py file for the myplotlib module
#
# ======================================================================
#
#
# IMPORT ---------------------------------------------------------------
import os as os
import numpy as np

# matplotlib
from matplotlib.pyplot import figure
from matplotlib.pyplot import rc
42
43
from matplotlib.pyplot import show, draw, ion, ioff, clf
from matplotlib.pyplot import close as mpclose
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
44
45
46
from matplotlib.pyplot import fignum_exists, savefig
from matplotlib.axes import Axes
from matplotlib.figure import Figure
47
from matplotlib import is_interactive
48
#from matplotlib import rcParams
49
50
from matplotlib import use

Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
51
# myplotlib
52
from .myData import MyData
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
53
54

# GLOBAL VARIABLE ------------------------------------------------------
55
G_RAWDATAS  = {'current': MyData()}  # raw data Object
56
_G_WINDOWS = []
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
57

58
59
60
61
62
63
64
65
# CONFIGURATION --------------------------------------------------------
from .config import INFO, WARN, SEVR, DBUG, SPCE
from .config import D_FIGNUM, D_FIGSIZE, D_REFORMAT, D_FORMATTED
from .config import D_RAWDATA, D_INPUTARG
from .config import D_IPATH
from .config import D_OPATH, D_OFORMAT
from .config import D_DEBUG
from .config import rcParams
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
66
67
68

# FUNCTIONS ------------------------------------------------------------
# MyAxes: Overlay on matplotlib.Axes class
69
from .myAxes import MyAxes
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
70
71

# MyFig: Overlay on matplotlib.Figure class
72
from .myFig import MyFig
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
73

74
# MyFig: Overlay on matplotlib.FigureManager class
75
if rcParams['backend'] == u'TkAgg':
76
    from .myWin_TkAgg import MyWin_TkAgg as MyWin
77
elif rcParams['backend'] == u'GTKAgg':
78
    from .myWin_GTKAgg import MyWin_GTKAgg as MyWin
79
elif rcParams['backend'] == u'WXAgg':
80
    from .myWin_WXAgg import MyWin_WXAgg as MyWin
81
82
else:
    print(SEVR + "The backend you choosed is not supported interactive mode not available")
83

Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
84
# myTool.*: interface functions to use myplotlib interactively
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
85
86
87
88
from .mytool import window_exists, getCurrentWindowIDs
from .mytool import print2file, print2screen, printListCurrentWindows
from .mytool import getWindow, getFigOnWindow, drawFigOnWindow, giveDataToWindow
from .mytool import closeWindow, closeAllWindows
89
from .mytool import FigOneAxes
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
90

91
from .test import myTest
92

93
# import the tests
94
from .test import test100
95
from .test import test200, test201, test202
96
from .test import test300, test301, test302, test303, test304, test305
97
98
from .test import test306, test307, test308, test309, test310, test311
from .test import test312
99
from .test import test400, test401, test402, test403
100
from .test import test500, test501, test502, test503, test504
101
from .test import test505, test506, test507, test508, test509
102
from .test import test510, test511
103
from .test import test600
104

105
# the tests to run
106
testList = [test100,
107
            test201, test202,
108
            test300, test301, test302, test303, test304, test305,
109
110
            test306, test307, test308, test309, test310, test311,
            test312,
111
            test400, test401, test402,
112
            test503, test506, test500, test507, test501, test502,
113
            test504, test505, test508, test509, test510, test511,
114
115
            test600,
            ]