[buildout] parts = environment pginit configs syseggs vic-build symlinks paths rheas test-nowcast-data test-forecast-data tests develop = . [paths] recipe = collective.recipe.template input = src/rpath.in output = src/rpath.py [environment] recipe = collective.recipe.environment [syseggs] recipe = osc.recipe.sysegg eggs = numpy gdal argparse scipy dateutil h5py psycopg2 netCDF4 [rheas] recipe = zc.recipe.egg interpreter = rheaspy extra-paths = ${buildout:directory}/lib/python2.7/site-packages /usr/lib/python2.7/dist-packages /usr/local/lib/python2.7/dist-packages eggs = rheas [pginit] recipe = collective.recipe.cmd on_install = true on_update = false cmds = sudo -u postgres createuser --superuser ${environment:USER} createdb rheas echo 'CREATE EXTENSION postgis;CREATE EXTENSION postgis_topology;' | psql -U ${environment:USER} -d rheas [vic-build] recipe = collective.recipe.cmd on_install = true on_update = true cmds = cd ${buildout:directory}/external/VIC/src make [symlinks] recipe = cns.recipe.symlink symlink = ${buildout:directory}/external/VIC/src/vicNl = ${buildout:directory}/bin/vicNl ${buildout:directory}/external/dssat/DSSAT_Ex.exe = ${buildout:directory}/bin/DSSAT_Ex.exe autocreate = false [configs] recipe = collective.recipe.cmd on_install = true on_update = false cmds = echo "begin; create schema vic; create schema dssat; commit;" | ${buildout:directory}/bin/psql -d rheas -U ${environment:USER} echo "begin; create schema crops; commit;" | ${buildout:directory}/bin/psql -d rheas -U ${environment:USER} echo "begin; create table vic.input (resolution double precision,snowbandfile text,vegparam text,veglib text,soilfile text,rootzones integer,basefile text);commit;" | ${buildout:directory}/bin/psql -d rheas -U ${environment:USER} echo "begin; insert into vic.input values (0.25, 'vic/global_snowbands_0.25deg.txt', 'vic/global_lai_0.25deg.txt', 'vic/vic_veglib.txt', 'vic/global_soil_0.25deg.txt', 2, 'vic/dssat.inp.base'); commit;" | ${buildout:directory}/bin/psql -d rheas -U ${environment:USER} echo "begin; create schema precip; create schema tmax; create schema tmin; create schema wind; create schema lai; commit;" | ${buildout:directory}/bin/psql -d rheas -U ${environment:USER} echo "begin; create table dssat.cultivars (gid serial primary key, ensemble int, geom geometry, p1 numeric, p2 numeric, p5 numeric, g2 numeric, g3 numeric, phint numeric); commit;" | ${buildout:directory}/bin/psql -d rheas -U ${environment:USER} gunzip ${buildout:directory}/data/vic/global_snowbands_0.25deg.txt.gz gunzip ${buildout:directory}/data/vic/global_lai_0.25deg.txt.gz gunzip ${buildout:directory}/data/vic/global_soil_0.25deg.txt.gz gunzip ${buildout:directory}/scripts/vicsoils.sql.gz ${buildout:directory}/bin/psql -d rheas -U ${environment:USER} -f ${buildout:directory}/scripts/vicsoils.sql [dssat] recipe = collective.recipe.cmd on_install = true on_update = false cmds = wget https://googledrive.com/host/0B-cBXVuysNV1TXVYd1BwSE05Zlk/MARS_CropMask250m_v2.2_AFR.tif.gz -P ${buildout:directory}/data/dssat/ gunzip ${buildout:directory}/data/dssat/MARS_CropMask250m_v2.2_AFR.tif.gz ${buildout:directory}/bin/raster2pgsql -d -I -t auto -s 4326 ${buildout:directory}/data/dssat/MARS_CropMask250m_v2.2_AFR.tif dssat.cropland | ${buildout:directory}/bin/psql -d rheas -U ${environment:USER} ${buildout:directory}/bin/raster2pgsql -s 4326 -d -t auto -I ${buildout:directory}/data/dssat/sage/Maize.crop.calendar.fill/plant.start.asc crops.plantstart | ${buildout:directory}/bin/psql -d rheas ${buildout:directory}/bin/raster2pgsql -s 4326 -a -t auto -I ${buildout:directory}/data/dssat/sage/Maize.2.crop.calendar.fill/plant.start.asc crops.plantstart | ${buildout:directory}/bin/psql -d rheas [tests] recipe = pbp.recipe.noserunner eggs = rheas script = test [test-nowcast-data] recipe = collective.recipe.template input = data/tests/nowcast.in output = data/tests/nowcast.conf [test-forecast-data] recipe = collective.recipe.template input = data/tests/forecast.in output = data/tests/forecast.conf [eafrica] recipe = collective.recipe.cmd shell = bash on_install = true on_update = false cmds = sh ${buildout:directory}/scripts/init_db.sh