myIOs.py 1.86 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
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# ================= FILE HEADER ========================================
#
#   myplotlib v0.0.0,
#
#   @file      myIOs.py
#   @author    Yori 'AGy' Fournier
#   @licence   CC-BY-SA
#
#   myIOs module: a few Input/Output functions for testing
#
#   @function readStupidData
#
#         create some stupid data format them as myData format
#         and add then in G_RAWDATA such that they could be used
#         by myAxes and myFig.
#
#   @function readStupidData2
#
#         same as readStupidData just with another identifier
#
#   @section History
#
#   v 0.0.0 - myIOs class for the myplotlib module.
#
# ======================================================================
#
#
# IMPORT ---------------------------------------------------------------
32
33
34
35
from . import DBUG
from . import D_IPATH
from . import MyData
from . import G_RAWDATAS
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72


# READ STUPID DATA -----------------------------------------------------
def readStupidData(ipath=D_IPATH, *args, **kwargs):

    debug = kwargs.get('debug', 0)

    lrawdata = MyData()
    lrawdata.name = str(ipath)
    lrawdata.data = [-1., 1., 1, -1.]
    G_RAWDATAS.update({lrawdata.name: lrawdata})
    G_RAWDATAS['current'] = lrawdata

    if(debug):
        print(DBUG + 'I read the raw data with readStupidData')
        print(DBUG + str(G_RAWDATAS['current'].name))

    return(lrawdata.name)


# READ STUPID DATA 2 ---------------------------------------------------
def readStupidData2(ipath=D_IPATH, *args, **kwargs):

    debug = kwargs.get('debug', 0)

    lrawdata = MyData()
    lrawdata.name = str(ipath)
    lrawdata.data = [-1., 1., -2., 2.]
    G_RAWDATAS.update({lrawdata.name: lrawdata})
    G_RAWDATAS['current'] = lrawdata

    if(debug):
        print(DBUG + 'I read the raw data with readStupidData2')
        print(DBUG + str(G_RAWDATAS['current'].name))

    return(lrawdata.name)