#!/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 --------------------------------------------------------------- from .. import DBUG from .. import D_IPATH from .. import MyData from .. import G_RAWDATAS # 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)