Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,738 changes: 1,395 additions & 1,343 deletions vcs/Canvas.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion vcs/boxfill.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ def datawc(self, dsp1=1e20, dsp2=1e20, dsp3=1e20, dsp4=1e20):
def xyscale(self, xat='linear', yat='linear'):
self.xaxisconvert = xat
self.yaxisconvert = yat
xyscale.__doc__ = xmldocs.xyscaledoc
xyscale.__doc__ = xmldocs.xyscaledoc % (('boxfill',) * 2)

def getlevels(self, varmin, varmax):
if self.boxfill_type == "custom":
Expand Down
2 changes: 1 addition & 1 deletion vcs/isofill.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ def datawc(self, dsp1=1e20, dsp2=1e20, dsp3=1e20, dsp4=1e20):
def xyscale(self, xat='', yat=''):
self.xaxisconvert = xat
self.yaxisconvert = yat
xyscale.__doc__ = xmldocs.xyscaledoc
xyscale.__doc__ = xmldocs.xyscaledoc % (('isofill',) * 2)

def list(self):
print "", "----------Isofill (Gfi) member (attribute) listings ----------"
Expand Down
2 changes: 1 addition & 1 deletion vcs/isoline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ def datawc(self, dsp1=1e20, dsp2=1e20, dsp3=1e20, dsp4=1e20):
def xyscale(self, xat='', yat=''):
self.xaxisconvert = xat
self.yaxisconvert = yat
xyscale.__doc__ = xmldocs.xyscaledoc
xyscale.__doc__ = xmldocs.xyscaledoc % (('isoline',) * 2)

def list(self):
if (self.name == '__removed_from_VCS__'):
Expand Down
3 changes: 1 addition & 2 deletions vcs/manageElements.py
Original file line number Diff line number Diff line change
Expand Up @@ -2507,8 +2507,7 @@ def getcolormap(Cp_name_src='default'):

:returns: A pre-existing VCS colormap object
:rtype: vcs.colormap.Cp

"""
"""
# Check to make sure the argument passed in is a STRING
if not isinstance(Cp_name_src, str):
raise ValueError('Error - The argument must be a string.')
Expand Down
263 changes: 154 additions & 109 deletions vcs/projection.py

Large diffs are not rendered by default.

241 changes: 118 additions & 123 deletions vcs/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
##########################################################################

"""
###########################################################################################
# #
# Functions which get information about vcs graphics objects such as graphics methods. #
# #
###########################################################################################
"""
import boxfill
import isofill
Expand Down Expand Up @@ -57,21 +52,20 @@ def isgraphicsmethod(gobj):

:Example:

::
.. doctest:: queries_isgraphicsmethod

a=vcs.init()
# To Modify an existing boxfill use:
box=a.getboxfill('quick')
#...
if vcs.isgraphicsmethod(box):
box.list()
>>> a=vcs.init()
>>> box=a.getboxfill('quick') # To Modify an existing boxfill
>>> vcs.isgraphicsmethod(box)
1

:param gobj: A graphics object
:type gobj: A VCS graphics object
:param gobj: A graphics object
:type gobj: A VCS graphics object

:returns: Integer reperesenting whether gobj is one of the above graphics methods. 1 indicates true, 0 indicates false.
:rtype:
"""
:returns: Integer reperesenting whether gobj is one of the above graphics methods.
1 indicates true, 0 indicates false.
:rtype:
"""
import vcsaddons
if (isinstance(gobj, boxfill.Gfb)):
return 1
Expand Down Expand Up @@ -105,16 +99,16 @@ def graphicsmethodlist():

:Example:

::
.. doctest:: queries_gmlist

a=vcs.init()
# Return graphics method list
gm_list=a.graphicsmethodlist()
>>> a=vcs.init()
>>> vcs.graphicsmethodlist() # Return graphics method list
['boxfill', 'isofill', 'isoline', 'meshfill', 'scatter', 'vector', 'xvsy', 'xyvsy', 'yxvsx', ...]

:returns: A list of available grapics methods (i.e., boxfill, isofill, isoline, outfill,
scatter, vector, xvsy, xyvsy, yxvsx, taylordiagram ).
:rtype: list
"""
:returns: A list of available grapics methods (i.e., 'boxfill', 'isofill', 'isoline', 'meshfill', 'scatter',
'vector', 'xvsy', 'xyvsy', 'yxvsx', 'taylordiagram', '1d', '3d_scalar', '3d_dual_scalar', '3d_vector').
:rtype: list
"""
return ['boxfill', 'isofill', 'isoline', 'meshfill', 'scatter',
'vector', 'xvsy', 'xyvsy', 'yxvsx', 'taylordiagram', '1d', '3d_scalar', '3d_dual_scalar', '3d_vector']

Expand All @@ -123,31 +117,31 @@ def graphicsmethodtype(gobj):
"""
Check the type of a graphics object.

Returns a None if the object is not a graphics method.
Returns None if the object is not a graphics method.

:Example:

::

a=vcs.init()
# Get an existing boxfill graphics method in VCS
box=a.getboxfill('quick')
# Get an existing isofill graphics method in VCS
iso=a.getisofill('quick')
# Get an existing line element in VCS
ln=a.getline('quick')
#...
# Will print 'boxfill'
print vcs.graphicsmethodtype(box)
# Will print 'isofill'
print vcs.graphicsmethodtype(iso)
# Will print None, because ln is not a graphics method
print vcs.graphicsmethodtype(ln)

:returns: If gobj is a graphics method object, returns its type: 'boxfill', 'isofill', 'isoline',
'scatter', 'vector', 'xvsy', 'xyvsy', or 'yxvsx', 'taylordiagram'.
If gobj is not a graphics method object, returns None.
:rtype: str or None
.. doctest:: queries_gmtype

>>> a=vcs.init()
>>> box=a.getboxfill('quick') # Get an existing boxfill graphics method in VCS:
>>>
>>> iso=a.getisofill('quick') # Get an existing isofill graphics method in VCS
>>> ln=a.getline('red') # Get an existing line element in VCS
>>> print vcs.graphicsmethodtype(box)
boxfill
>>> print vcs.graphicsmethodtype(iso)
isofill
>>> print vcs.graphicsmethodtype(ln)
Traceback (most recent call last):
...
vcsError: The object passed is not a graphics method object.

:returns: If gobj is a graphics method object, returns its type: 'boxfill', 'isofill', 'isoline', 'meshfill',
'scatter', 'vector', 'xvsy', 'xyvsy', 'yxvsx', 'taylordiagram', '1d', '3d_scalar', '3d_dual_scalar',
'3d_vector'.
If gobj is not a graphics method object, raises an exception and prints a vcsError message.
:rtype: str or None
"""
import vcsaddons
if (isinstance(gobj, boxfill.Gfb)):
Expand Down Expand Up @@ -180,25 +174,25 @@ def isplot(pobj):
"""
Check to see if this object is a VCS secondary display plot.

:Example:
:Example:

::
.. doctest:: queries_isplot

a=vcs.init()
# Show all available display
a.show('display')
# To test an existing display object
test_obj = a.getdisplay('default')
# ...
if queries.isdisplay(test_obj):
test_obj.list()
>>> a=vcs.init()
>>> a.show('display') # Show all available displays
*******************Display Names List**********************
...
*******************End Display Names List**********************
>>> ex = a.getplot('default') # To test an existing display object
>>> vcs.queries.isplot(ex)
1

:param obj: A VCS object
:type obj: VCS Object
:param obj: A VCS object
:type obj: VCS Object

:returns: An integer indicating whether the object is a display plot (1), or not (0).
:rtype: int
"""
:returns: An integer indicating whether the object is a display plot (1), or not (0).
:rtype: int
"""
if (isinstance(pobj, displayplot.Dp)):
return 1
else:
Expand All @@ -209,25 +203,25 @@ def iscolormap(obj):
"""
Check to see if this object is a VCS secondary colormap.

:Example:
:Example:

::
.. doctest:: queries_iscolormap

a=vcs.init()
# Show all available colormap
a.show('colormap')
# To test an existing colormap object
test_obj = a.getcolormap('default')
# ...
if queries.iscolormap(test_obj):
test_obj.list()
>>> a=vcs.init()
>>> a.show('colormap') # Show all available colormap objects
*******************Colormap Names List**********************
...
*******************End Colormap Names List**********************
>>> ex = a.getcolormap('default') # To test an existing colormap object
>>> vcs.iscolormap(ex)
1

:param obj: A VCS object
:type obj: VCS Object
:param obj: A VCS object
:type obj: VCS Object

:returns: An integer indicating whether the object is a colormap (1), or not (0).
:rtype: int
"""
:returns: An integer indicating whether the object is a colormap (1), or not (0).
:rtype: int
"""
if (isinstance(obj, vcs.colormap.Cp)):
return 1
else:
Expand All @@ -238,25 +232,25 @@ def istemplate(gobj):
"""
Check to see if this object is a template.

:Example:
:Example:

::
.. doctest:: queries_istemplate

a=vcs.init()
# Show all available template
a.show('template')
# To test an existing template object
test_obj = a.gettemplate('default')
# ...
if queries.istemplate(test_obj):
test_obj.list()
>>> a=vcs.init()
>>> a.show('template') # Show all available template
*******************Template Names List**********************
...
*******************End Template Names List**********************
>>> ex = a.gettemplate('default') # To test an existing template object
>>> vcs.istemplate(ex)
1

:param obj: A VCS object
:type obj: VCS Object
:param obj: A VCS object
:type obj: VCS Object

:returns: An integer indicating whether the object is a template (1), or not (0)
:rtype: int
"""
:returns: An integer indicating whether the object is a template (1), or not (0)
:rtype: int
"""
if (isinstance(gobj, template.P)):
return 1
else:
Expand All @@ -265,9 +259,10 @@ def istemplate(gobj):

def issecondaryobject(sobj):
"""
Check to see if this object is a VCS secondary object
Check to see if this object is a VCS secondary object

.. note::

Secondary objects will be one of the following:
1.) colormap: specification of combinations of 256 available
colors
Expand All @@ -283,25 +278,25 @@ def issecondaryobject(sobj):
horizontal/vertical alignment
9.) projections

:Example:
:Example:

::
.. doctest:: queries_issecondary

a=vcs.init()
# Show all available lines
a.show('line')
# To test an existing line object
test_obj = a.getprojection('default')
# ...
if queries.issecondaryobject(test_obj):
test_obj.list()
>>> a=vcs.init()
>>> a.show('projection') # Show all available projections
*******************Line Names List**********************
...
*******************End Line Names List**********************
>>> ex = a.getprojection('default') # To test an existing line object
>>> vcs.issecondaryobject(ex)
1

:param obj: A VCS object
:type obj: VCS Object
:param obj: A VCS object
:type obj: VCS Object

:returns: An integer indicating whether the object is a projection graphics object (1), or not (0).
:rtype: int
"""
:returns: An integer indicating whether the object is a projection graphics object (1), or not (0).
:rtype: int
"""
if (isinstance(sobj, line.Tl)):
return 1
elif (isinstance(sobj, marker.Tm)):
Expand All @@ -328,25 +323,25 @@ def isprojection(obj):
"""
Check to see if this object is a VCS secondary projection graphics object.

:Example:
:Example:

::
.. doctest:: queries_isprojection

a=vcs.init()
# Show all available projection
a.show('projection')
# To test an existing projection object
test_obj = a.getprojection('default')
# ...
if queries.isprojection(test_obj):
test_obj.list()
>>> a=vcs.init()
>>> a.show('projection') # Show all available projection
*******************Projection Names List**********************
...
*******************End Projection Names List**********************
>>> ex = a.getprojection('default') # To test an existing projection object
>>> vcs.isprojection(ex)
1

:param obj: A VCS object
:type obj: VCS Object
:param obj: A VCS object
:type obj: VCS Object

:returns: An integer indicating whether the object is a projection graphics object (1), or not (0).
:rtype: int
"""
:returns: An integer indicating whether the object is a projection graphics object (1), or not (0).
:rtype: int
"""
if (isinstance(obj, projection.Proj)):
return 1
else:
Expand Down
Loading