diff --git a/.gitignore b/.gitignore index 5db498ed7..ba8da8a25 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ dist/ dist/ vcs.egg-info/ *.swp +uvcdat-testdata/ diff --git a/tests/test_vcs_lists.py b/tests/test_vcs_lists.py new file mode 100644 index 000000000..9e4b98151 --- /dev/null +++ b/tests/test_vcs_lists.py @@ -0,0 +1,16 @@ +import unittest +import vcs + +class TestVCSList(unittest.TestCase): + def test_list_function(self): + types = vcs.listelements() + + for typ in types: + if typ in ["display", "font", "fontNumber", "list"]: + continue + print("testing: ",typ) + ldict = locals() + exec("obj = vcs.create{}()".format(typ), globals(), ldict) + obj = ldict['obj'] + obj.list() + diff --git a/vcs/vector.py b/vcs/vector.py index 3b878fb41..720239ad2 100755 --- a/vcs/vector.py +++ b/vcs/vector.py @@ -255,16 +255,16 @@ class Gv(vcs.bestMatch): .. code-block:: python - # Same as vc.line='solid' - vc.line=0 - # Same as vc.line='dash' - vc.line=1 - # Same as vc.line='dot' - vc.line=2 - # Same as vc.line='dash-dot' - vc.line=3 - # Same as vc.line='long-dot' - vc.line=4 + # Same as vc.linetype='solid' + vc.linetype=0 + # Same as vc.linetype='dash' + vc.linetype=1 + # Same as vc.linetype='dot' + vc.linetype=2 + # Same as vc.linetype='dash-dot' + vc.linetype=3 + # Same as vc.linetype='long-dot' + vc.linetype=4 * Specify the line color of the vectors: @@ -275,6 +275,24 @@ class Gv(vcs.bestMatch): # Width range: 1 to 100, default size is 1 vc.linewidth=1 + * Specify the vector scaling type + + .. code-block:: python + + # One of the following strings: + # off - No scaling is performed on the vector values + vc.scaletype = "off" + # constant - vector value * self.scale + vc.scaletype = "constant" + # normalize - vector value / max_norm + vc.scaletype = "normalize" + # constantNNormalize - vector value * self.scale / max_norm (default) + vc.scaletype = "constantNNormalize" + # linear - map [min_norm, max_norm] to self.scalerange + vc.scaletype = "linear" + # constantNLinear - map [min_norm, max_norm] to self.scalerange and then multiply by self.scale + vc.scaletype = "constantNLinear" + * Specify the vector scale factor: .. code-block:: python @@ -776,7 +794,7 @@ def list(self): print("datawc_calendar = ", self.datawc_calendar) print("xaxisconvert = ", self.xaxisconvert) print("yaxisconvert = ", self.yaxisconvert) - print("line = ", self.line) + print("linetype = ", self.linetype) print("linecolor = ", self.linecolor) print("linewidth = ", self.linewidth) print("scale = ", self.scale)