Skip to content

Commit

Permalink
Merge pull request #14 from UV-CDAT/dwnld_only_needed_smpl_data
Browse files Browse the repository at this point in the history
Dwnld only needed smpl data
  • Loading branch information
doutriaux1 authored Mar 30, 2017
2 parents 7b5d33a + 5926fde commit c32c24a
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 14 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ before_install:
- conda update -y -q conda
- conda install gcc
script:
- conda install -c conda-forge -c uvcdat/label/nightly -c uvcdat uvcdat nose image-compare
- conda install -c uvcdat/label/nightly -c conda-forge -c uvcdat nose cdms2 genutil cdat_info
- export UVCDAT_ANONYMOUS_LOG=False
- echo $TRAVIS_BRANCH
- export TRAVIS_PR_BRANCH=$TRAVIS_BRANCH
- echo $TRAVIS_EVENT_TYPE
- echo $TRAVIS_PULL_REQUEST
- python setup.py install
- vcs_download_sample_data
- pip install dropbox
- python run_tests.py --dropbox -v2
after_success:
Expand Down
8 changes: 3 additions & 5 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import argparse
import multiprocessing
import subprocess
import image_compare
import codecs
import time
import webbrowser
import shlex
import cdat_info

root = os.getcwd()
cpus = multiprocessing.cpu_count()
Expand Down Expand Up @@ -160,9 +160,7 @@ def run_nose(test_name):
sys.exit(0)

# Make sure we have sample data
import vcs
reload(vcs)
vcs.download_sample_data_files()
cdat_info.download_sample_data_files(os.path.join(sys.prefix,"share","cdutil","test_data_files.txt"),cdat_info.get_sampledata_path())

p = multiprocessing.Pool(args.cpus)
outs = p.map(run_nose, names)
Expand All @@ -189,7 +187,7 @@ def run_nose(test_name):
os.makedirs("tests_html")
os.chdir("tests_html")

js = image_compare.script_data()
js = ""

fi = open("index.html", "w")
print>>fi, "<!DOCTYPE html>"
Expand Down
2 changes: 0 additions & 2 deletions scripts/circleci_mac.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
export UVCDAT_ANONYMOUS_LOG=False
export PATH=${HOME}/miniconda/bin:${PATH}
#export VCS_BACKGROUND=0 # circleci seg faults on bg=1
#python run_tests.py -v2 -g -H -p # -H and -p for collection by artifacts
python run_tests.py --dropbox -v2

3 changes: 1 addition & 2 deletions scripts/circleci_mac_dep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
ls
pwd
export PATH=${HOME}/miniconda/bin:${PATH}
conda install -c conda-forge -c uvcdat uvcdat pyopenssl nose image-compare
conda install -c uvcdat/label/nightly -c conda-forge -c uvcdat nose cdms2 genutil cdat_info
pip install dropbox
export UVCDAT_ANONYMOUS_LOG=False
vcs_download_sample_data
python setup.py install
2 changes: 1 addition & 1 deletion scripts/conda_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cd conda-recipes
rm -rf uvcdat
python ./prep_for_build.py -v `date +%Y.%m.%d`
echo "Building now"
conda build -c conda-forge -c uvcdat/label/nightly -c uvcdat cdutil
conda build -c uvcdat/label/nightly -c conda-forge -c uvcdat cdutil
echo "Uploading"
anaconda -t $CONDA_UPLOAD_TOKEN upload -u $USER -l nightly $CONDA_BLD_PATH/$OS/$PKG_NAME-`date +%Y.%m.%d`-py27_0.tar.bz2 --force

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
url = "http://cdat.sourceforge.net",
packages = ['cdutil'],
package_dir = {'cdutil': 'Lib'},
data_files = [ ("share/cdutil",("data/sftbyrgn.nc","data/navy_land.nc"))],
data_files = [ ("share/cdutil",("data/sftbyrgn.nc","data/navy_land.nc","share/test_data_files.txt"))],
)

26 changes: 26 additions & 0 deletions share/test_data_files.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
http://uvcdat.llnl.gov/cdat/sample_data
aa51aa896ead44019335cebec68e7955 clt.nc
332feb65b3801d7ab25845976bd23d85 vertical.nc
0f928d5cc8b80e6a509a0a00f0fc87ad tas_mo.nc
c20b5a0f5f6d031436730df16ad42ab6 tas_mo_clim.nc
9b9d7a921ec5bd0543fccd8631f9952d tas_6h.nc
afb02c59e3f652a717d742301554fe88 tas_dnm-95a.xml
e6d4f903e838727cf9e4e0db5d670eef tas_dnm-95a_1979.01-1979.12.nc
b34783fb0d22b086aae509241d560028 tas_dnm-95a_1980.01-1980.12.nc
01108e023b3546feb81b78fe87a5577e tas_dnm-95a_1981.01-1981.12.nc
e7efa57b90644b0c913f3a305f53107f tas_dnm-95a_1982.01-1982.12.nc
393b5e8dc612d8b3f5ae13d32d10c630 tas_dnm-95a_1983.01-1983.12.nc
51710f1227e920baff86b6381f5300f3 tas_dnm-95a_1984.01-1984.12.nc
ad901a938a9e699156a6da75d3ae61bd psl_6h.nc
062b7374a7ba0febf829e58f829c612b sftlf_dnm.nc
acf9323a1f057415cb6a2e06f3a6050d tas_ccsr-95a.xml
4e4648ad9855cb71259926c9d4a1d361 tas_ccsr-95a_1979.01-1979.12.nc
c366a478a1aacc30f4a3aab608c1d6c8 tas_ccsr-95a_1980.01-1980.12.nc
3ce21dafefa4eefba3adef225d791623 tas_ccsr-95a_1981.01-1981.12.nc
919efd749b5dfd00d36cb8a77464ba9d tas_ccsr-95a_1982.01-1982.12.nc
ee4c335a071bd9ca5f3ed2a94bfe1b17 tas_ccsr-95a_1983.01-1983.12.nc
3f04f9e3a21226da7dc88f77e6e11ec6 tas_ccsr-95a_1984.01-1984.12.nc
efc5c823c15f779b33b38b78e24f1470 sftlf_ccsr.nc
34642d5985bcb922212caee375bd13e2 sftlf_10x10.nc
2bc000558f676e0b3ce596b8346af3db ts_da.nc
ee4a4b2827c126d48a2c177771d7a69c th_yr.nc
2 changes: 1 addition & 1 deletion tests/test_cdutil_gen_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class CDUTIL(unittest.TestCase):
def testGenmask(self):

f=cdms2.open(os.path.join(cdat_info.get_sampledata_path(),"navy_land.nc"))
f=cdms2.open(os.path.join(sys.prefix,"share","cdutil","navy_land.nc"))
navy_frac = f("sftlf")/100.

target = cdms2.open(os.path.join(cdat_info.get_sampledata_path(),'clt.nc'))("clt",slice(0,1)).getGrid()
Expand Down

0 comments on commit c32c24a

Please sign in to comment.