Commit 1402ef8d authored by Yori 'AGy' Fournier's avatar Yori 'AGy' Fournier
Browse files

reorganised mytool:

Now myTool.py is in the module mytool

mytool contains now 3 more classes:
- AxOneAxes_base
- AxOneAxes2D
- AxOneAxes3D

partially tested, but tests are not yet implemented
parent 1cc0812f
......@@ -48,7 +48,7 @@ from matplotlib import is_interactive
from matplotlib import rcParams
from matplotlib import use
rcParams['backend'] = u'GTKAgg'
rcParams['backend'] = u'TKAgg'
# myplotlib
from myData import MyData
......@@ -114,10 +114,11 @@ else:
print(SEVR + "The backend you choosed is not supported interactive mode not available")
# myTool.*: interface functions to use myplotlib interactively
from .myTool import window_exists, getCurrentWindowIDs
from .myTool import print2file, print2screen, printListCurrentWindows
from .myTool import getWindow, getFigOnWindow, drawFigOnWindow, giveDataToWindow
from .myTool import closeWindow, closeAllWindows
from .mytool import window_exists, getCurrentWindowIDs
from .mytool import print2file, print2screen, printListCurrentWindows
from .mytool import getWindow, getFigOnWindow, drawFigOnWindow, giveDataToWindow
from .mytool import closeWindow, closeAllWindows
from .mytool import FigOneAxes_base, FigOneAxes2D, FigOneAxes3D
from .test import myTest
......
from myTool import print2file
from myTool import print2screen
from myTool import getCurrentWindowIDs
from myTool import getFigOnWindow
from myTool import getWindow
from myTool import printListCurrentWindows
from myTool import window_exists
from myTool import setCurrentData
from myTool import giveDataToWindow
from myTool import drawFigOnWindow
from myTool import closeAllWindows
from myTool import closeWindow
from figOneAxes_base import FigOneAxes_base
from figOneAxes2D import FigOneAxes2D
from figOneAxes3D import FigOneAxes3D
# Import --------------------------------------------------------------
from figOneAxes_base import FigOneAxes_base
# Default values ------------------------------------------------------
_D_XRANGE = None
_D_YRANGE = None
_D_LOGX = False
_D_LOGY = False
# CLASS MyNewFig ------------------------------------------------------
class FigOneAxes2D(FigOneAxes_base):
# DECLARE kEYWORDS ------------------------------------------------
def declareKeywords(self):
self.keywords = {'xrange' : _D_XRANGE,
'yrange' : _D_YRANGE,
'logx' : _D_LOGX,
'logy' : _D_LOGY}
# Import --------------------------------------------------------------
from figOneAxes_base import FigOneAxes_base
# Default values ------------------------------------------------------
_D_XRANGE = None
_D_YRANGE = None
_D_ZRANGE = None
_D_LOGX = False
_D_LOGY = False
_D_LOGZ = False
# CLASS MyNewFig ------------------------------------------------------
class FigOneAxes3D(FigOneAxes_base):
# DECLARE kEYWORDS ------------------------------------------------
def declareKeywords(self):
self.keywords = {'xrange' : _D_XRANGE,
'yrange' : _D_YRANGE,
'zrange' : _D_ZRANGE,
'logx' : _D_LOGX,
'logy' : _D_LOGY,
'logz' : _D_LOGZ}
# Import --------------------------------------------------------------
from .. import MyFig
# Default values ------------------------------------------------------
_D_XRANGE = None
_D_YRANGE = None
_D_LOG = False
# CLASS MyNewFig ------------------------------------------------------
class FigOneAxes_base(MyFig):
# Set the size of the Figure in inch
FIGSIZE = (8., 6.)
# CONSTRUCTOR -----------------------------------------------------
def __init__(self, rawdata, AxClass, *args, **kwargs):
self.AxClass = AxClass
MyFig.__init__(self, rawdata, *args, **kwargs)
# DECLARE kEYWORDS ------------------------------------------------
def declareKeywords(self):
self.keywords = {'xrange' : _D_XRANGE,
'yrange' : _D_YRANGE,
'log' : _D_LOG}
# ADD AXES --------------------------------------------------------
def addAxes(self):
ratio = 6. / 8.
frame = [0.0, 0.0, 1.0, 1.0]
self.add_axes(self.AxClass(self, ratio, frame))
......@@ -34,15 +34,15 @@
# ======================================================================
#
# IMPORT ---------------------------------------------------------------
from . import D_OPATH, D_OFORMAT
from . import G_RAWDATAS, _G_WINDOWS
from . import INFO, SEVR, WARN, SPCE
from .. import D_OPATH, D_OFORMAT
from .. import G_RAWDATAS, _G_WINDOWS
from .. import INFO, SEVR, WARN, SPCE
from . import ion, ioff, is_interactive
from .. import ion, ioff, is_interactive
from . import MyWin
from .. import MyWin
from . import np
from .. import np
# TOOL FUNCTION FOR READING EXISTING DATA ------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment