Skip to content

Commit

Permalink
Vcs templates (#384)
Browse files Browse the repository at this point in the history
* fix #380

* no pribt debug

* renamed Share to share

* trying to use dan mac build and do linkage

* correct job name

* downgrade conda

* Shre is now share

* ok animation zvalue is not correct need to add this tomorrow

* baselines, and beg of flake8

* flake8 passes again

* all tests pass on my mac py3

* correct prefix

* correct the typo

* on my mac no need to do the ln if mesalib

* try to get the mesalib version and only run mac py3

* seems to not trigger...

* ok... still no trigger, removing all comemnts

* ok putting all jobs back in...

* trying to use 1/26 mesalib with symlinking

* correct sign for version

* correct symlinking?

* fine tuning doc strings

* new flake8 on linux picked these up

* missed one new flake8 failure
  • Loading branch information
doutriaux1 authored Jan 30, 2019
1 parent c8a8363 commit 22418d8
Show file tree
Hide file tree
Showing 51 changed files with 243 additions and 227 deletions.
18 changes: 15 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@ aliases:
name: create_conda_env
environment:
CHANNELS: "-c cdat/label/nightly -c conda-forge -c cdat"
PKGS: "cdms2 cdat_info udunits2 testsrunner mesalib matplotlib image-compare genutil dv3d cdutil cdtime nbformat 'vtk-cdat>8.1' 'proj4<5' 'numpy>1.14' ghostscript"
PKGS: "cdms2 cdat_info udunits2 testsrunner mesalib matplotlib image-compare genutil dv3d cdutil cdtime nbformat 'vtk-cdat<8.2.0.rc2.289.8.0.2019.01.28.16' 'proj4<5' 'numpy>1.14' ghostscript"
command: |
export PATH=$WORKDIR/miniconda/bin:$PATH
conda config --set always_yes yes --set changeps1 no
conda update -y -q conda
conda install -n base "conda<4.6"
conda config --set anaconda_upload no
if [[ $PY_VER = "py2" ]]; then
conda create -q -n $PY_VER $CHANNELS $PKGS $TEMP_PKGS "python<3"
conda create -q -n $PY_VER $CUSTOM_CHANNELS $CHANNELS $PKGS $TEMP_PKGS "python<3"
else
conda create -q -n $PY_VER $CHANNELS $PKGS $TEMP_PKGS "python>3" nbsphinx easydev $COVERAGE_PKGS
conda create -q -n $PY_VER $CUSTOM_CHANNELS $CHANNELS $PKGS $TEMP_PKGS "python>3" nbsphinx easydev $COVERAGE_PKGS
fi
- &setup_vcs
Expand Down Expand Up @@ -70,6 +71,14 @@ aliases:
fi
exit $RESULT
- &templink
name: templink
command: |
export PATH=$WORKDIR/miniconda/bin:$PATH
source activate $PY_VER
rm ${WORKDIR}/miniconda/envs/$PY_VER/bin/python
ln -s $(pwd)/$WORKDIR/miniconda/envs/$PY_VER/bin/vtkpython $(pwd)/$WORKDIR/miniconda/envs/$PY_VER/bin/python
- &conda_upload
name: conda_upload
environment:
Expand Down Expand Up @@ -120,6 +129,7 @@ jobs:
OS: "osx-64"
PY_VER: "py2"
TEMP_PKGS: "'ffmpeg>4' 'libpng>1.6.34'"
CUSTOM_CHANNELS: "-c danlipsa"
steps:
- checkout
- run: *setup_miniconda
Expand All @@ -142,11 +152,13 @@ jobs:
OS: "osx-64"
PY_VER: "py3"
TEMP_PKGS: "'ffmpeg>4' 'libpng>1.6.34'"
CUSTOM_CHANNELS: "-c danlipsa"
steps:
- checkout
- run: *setup_miniconda
- run: *get_testdata
- run: *create_conda_env
- run: *templink
- run: *setup_vcs
- run: *run_vcs_tests
- store_artifacts:
Expand Down
2 changes: 1 addition & 1 deletion run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def _prep_nose_options(self):
runner = VCSTestRunner(test_suite_name, options=["--no-vtk-ui", "--vtk"],
options_files=["tests/vcs_runtests.json"],
get_sample_data=True,
test_data_files_info="Share/test_data_files.txt")
test_data_files_info="share/test_data_files.txt")
ret_code = runner.run(workdir)

sys.exit(ret_code)
38 changes: 19 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,25 @@
#package_dir={'vcs': 'vcs'},
scripts= ["scripts/vcs_download_sample_data"],
zip_safe=True,
data_files=[('share/vcs', ('Share/wmo_symbols.json',
'Share/data_continent_coarse',
'Share/data_continent_political',
'Share/data_continent_river',
'Share/data_continent_states',
'Share/data_continent_other7',
'Share/data_continent_fine',
'Share/initial.attributes',
'Share/cdat.png',
'Share/marker_icon.png',
'Share/text_icon.png',
'Share/fill_icon.png',
'Share/line_icon.png',
'Share/sample_files.txt',
'Share/mapper.js',
'Share/cvi_tip_lib.js',
'Share/tooltip.css',
'Share/modal.js',
'Share/test_data_files.txt')),
data_files=[('share/vcs', ('share/wmo_symbols.json',
'share/data_continent_coarse',
'share/data_continent_political',
'share/data_continent_river',
'share/data_continent_states',
'share/data_continent_other7',
'share/data_continent_fine',
'share/initial.attributes',
'share/cdat.png',
'share/marker_icon.png',
'share/text_icon.png',
'share/fill_icon.png',
'share/line_icon.png',
'share/sample_files.txt',
'share/mapper.js',
'share/cvi_tip_lib.js',
'share/tooltip.css',
'share/modal.js',
'share/test_data_files.txt')),
('share/vcs/fonts', ('Fonts/Adelon_Regular.ttf',
'Fonts/Arabic.ttf',
'Fonts/Athens_Greek.ttf',
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 9 additions & 9 deletions tests/share/template_test_associated_dump.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
"y": 0.922999978065
},
"tname": {
"priority": 1,
"priority": 0,
"textorientation": "default",
"texttable": "default",
"x": 0.0,
Expand All @@ -217,7 +217,7 @@
},
"tvalue": {
"format": "default",
"priority": 1,
"priority": 0,
"textorientation": "default",
"texttable": "default",
"x": 0.800000011921,
Expand Down Expand Up @@ -274,15 +274,15 @@
"y2": 0.871999979019
},
"xunits": {
"priority": 1,
"priority": 0,
"textorientation": "default",
"texttable": "default",
"x": 0.600000023842,
"y": 0.277000010014
"y": 0.21
},
"xvalue": {
"format": "default",
"priority": 1,
"priority": 0,
"textorientation": "default",
"texttable": "default",
"x": 0.800000011921,
Expand Down Expand Up @@ -332,15 +332,15 @@
"x2": 0.959999978542
},
"yunits": {
"priority": 1,
"textorientation": "default",
"priority": 0,
"textorientation": "defup",
"texttable": "default",
"x": 0.019999999553,
"x": 0.006,
"y": 0.658999979496
},
"yvalue": {
"format": "default",
"priority": 1,
"priority": 0,
"textorientation": "default",
"texttable": "default",
"x": 0.800000011921,
Expand Down
14 changes: 7 additions & 7 deletions vcs/Canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,9 +714,9 @@ def _reconstruct_tv(self, arglist, keyargs):
isgridded = (grid is not None)

# Set the default graphics method if not already set.
# See _determine_arg_list
if arglist[GRAPHICS_METHOD] == "default" or\
(arglist[GRAPHICS_METHOD] == 'boxfill' and arglist[GRAPHICS_METHOD + 1] == "default"):
# See _determine_arg_list

if grid is None:
if tv.ndim == 1:
Expand Down Expand Up @@ -2823,13 +2823,13 @@ def __new_elts(self, original, new):

def __plot(self, arglist, keyargs):

# This routine has five arguments in arglist from _determine_arg_list
# It adds one for bg and passes those on to Canvas.plot as its sixth
# arguments.
# This routine has five arguments in arglist from _determine_arg_list
# It adds one for bg and passes those on to Canvas.plot as its sixth
# arguments.

# First of all let's remember which elets we have before comin in here
# so that anything added (temp objects) can be removed at clear
# time
# First of all let's remember which elets we have before comin in here
# so that anything added (temp objects) can be removed at clear
# time
original_elts = {}
new_elts = {}
for k in list(vcs.elements.keys()):
Expand Down
3 changes: 3 additions & 0 deletions vcs/Pformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,18 @@ def __init__(self, member):
if member == "xvalue":
self.x = 0.800000011921
self.y = 0.941999971867
self.priority = 0
elif member == "yvalue":
self.x = 0.800000011921
self.y = 0.922999978065
self.priority = 0
elif member == "zvalue":
self.x = 0.800000011921
self.y = 0.902999997139
elif member == "tvalue":
self.x = 0.800000011921
self.y = 0.883000016212
self.priority = 0
elif member == "mean":
self.x = 0.0500000007451
self.y = 0.899999976158
Expand Down
8 changes: 6 additions & 2 deletions vcs/Ptext.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,16 @@ def __init__(self, member):
elif member == "tname":
self.x = 0.
self.y = 0.995000004768
self.priority = 0
elif member == "xunits":
self.x = 0.600000023842
self.y = 0.277000010014
self.y = 0.21
self.priority = 0
elif member == "yunits":
self.x = 0.019999999553
self.x = 0.006
self.y = 0.658999979496
self.textorientation = "defup"
self.priority = 0
elif member == "zunits":
self.x = 0.
self.y = 0.995000004768
Expand Down
4 changes: 2 additions & 2 deletions vcs/VCS_validation_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def checkContinents(self, value):
"data_continent_%s" % nms[value - 1])

if not os.path.exists(path):
# fallback on installed with system one
# fallback on installed with system one
path = os.path.join(
vcs.vcs_egg_path,
"data_continent_%s" % nms[
Expand Down Expand Up @@ -365,7 +365,7 @@ def checkMarker(self, name, value):
elif value in range(100, 203):
value = "w%.2i" % (value - 100)
elif (queries.ismarker(value) == 1):
value = value.name
value = value.name

else:
checkedRaise(
Expand Down
2 changes: 2 additions & 0 deletions vcs/VTKPlots.py
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,8 @@ def renderTemplate(self, tmpl, data, gm, taxis,

# ok first basic template stuff, let's store the displays
# because we need to return actors for min/max/mean
kargs["taxis"] = taxis
kargs["zaxis"] = zaxis
displays = tmpl.plot(
self.canvas,
data,
Expand Down
18 changes: 9 additions & 9 deletions vcs/colormap.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,15 @@ def setindex(self, value):
##########################################################################

def __init__(self, Cp_name, Cp_name_src='default'):
# #
###############################################################
# Initialize the colormap class and its members #
# #
# The getCpmember function retrieves the values of the #
# colormap members in the C structure and passes back the #
# appropriate Python Object. #
###############################################################
# #
# #
###############################################################
# Initialize the colormap class and its members #
# #
# The getCpmember function retrieves the values of the #
# colormap members in the C structure and passes back the #
# appropriate Python Object. #
###############################################################
# #
self.s_name = 'Cp'
self._name = Cp_name
if Cp_name == "default":
Expand Down
16 changes: 8 additions & 8 deletions vcs/displayplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,14 @@ def _set_backend(self, value):
# #
##########################################################################
def __init__(self, Dp_name, Dp_name_src='default', parent=None):
# #
###################################################################
# Initialize the display plot's class and its members #
# The getDpmember function retrieves the values of the #
# display plot members in the C structure and passes back the #
# appropriate Python Object. #
###################################################################
# #
# #
###################################################################
# Initialize the display plot's class and its members #
# The getDpmember function retrieves the values of the #
# display plot members in the C structure and passes back the #
# appropriate Python Object. #
###################################################################
# #
self.extradisplays = []
self._name = Dp_name
self.s_name = 'Dp'
Expand Down
16 changes: 8 additions & 8 deletions vcs/fillarea.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,14 +387,14 @@ def _sety(self, value):
#
#
def __init__(self, Tf_name=None, Tf_name_src='default'):
#
#
# Initialize the fillarea class and its members #
# The getTfmember function retrieves the values of the #
# fillarea members in the C structure and passes back the #
# appropriate Python Object. #
#
#
#
#
# Initialize the fillarea class and its members #
# The getTfmember function retrieves the values of the #
# fillarea members in the C structure and passes back the #
# appropriate Python Object. #
#
#
if isinstance(Tf_name_src, Tf):
Tf_name_src = Tf_name_src.name
if Tf_name_src != "default" and Tf_name_src not in list(vcs.elements[
Expand Down
16 changes: 8 additions & 8 deletions vcs/isofill.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,14 +574,14 @@ def _setdatawc_y2(self, value):
levels = VCS_validation_functions.levels

def __init__(self, Gfi_name, Gfi_name_src='default'):
#
#
# Initialize the isofill class and its members #
# The getGfimember function retrieves the values of the #
# isofill members in the C structure and passes back the #
# appropriate Python Object. #
#
#
#
#
# Initialize the isofill class and its members #
# The getGfimember function retrieves the values of the #
# isofill members in the C structure and passes back the #
# appropriate Python Object. #
#
#
if not isinstance(Gfi_name, str):
raise ValueError("Isofill name must be a string")
if Gfi_name in list(vcs.elements["isofill"].keys()):
Expand Down
16 changes: 8 additions & 8 deletions vcs/isoline.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,14 +886,14 @@ def _setclockwise(self, value):
clockwise = property(_getclockwise, _setclockwise)

def __init__(self, Gi_name, Gi_name_src='default'):
# #
###########################################################
# Initialize the isoline class and its members #
# The getGimember function retrieves the values of the #
# isoline members in the C structure and passes back the #
# appropriate Python Object. #
###########################################################
# #
# #
###########################################################
# Initialize the isoline class and its members #
# The getGimember function retrieves the values of the #
# isoline members in the C structure and passes back the #
# appropriate Python Object. #
###########################################################
# #
if not isinstance(Gi_name, str):
raise ValueError("Isoline name must be a string")
if Gi_name in list(vcs.elements["isoline"].keys()):
Expand Down
Loading

0 comments on commit 22418d8

Please sign in to comment.