Changeset 9615
- Timestamp:
- Feb 5, 2015, 4:18:25 PM (10 years ago)
- Location:
- trunk/anuga_core
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/.travis.yml
r9613 r9615 1 1 language: python 2 virtualenv: 3 system_site_packages: true 2 4 env: 3 matrix:4 - PYTHON_VERSION="2.7"5 - PYTHON_VERSION="2.6"5 matrix: 6 - PYTHON_VERSION="2.7" 7 - PYTHON_VERSION="2.6" 6 8 install: 7 9 - sudo apt-get update … … 19 21 # Useful for debugging any issues with conda 20 22 - conda info -a 23 # More debugging 24 - printenv 21 25 22 26 # Conda dependencies 23 - conda create - q -n test-environment python="$PYTHON_VERSION" scipy gdalnetcdf4 nose matplotlib27 - conda create -n test-environment --yes python=$PYTHON_VERSION numpy scipy gdal geos netcdf4 nose matplotlib 24 28 - source activate test-environment 29 - conda install -c https://conda.binstar.org/pingucarsti gdal-data 25 30 # python 2.6 doesn't have argparse by default 26 - if [[ "$PYTHON_VERSION" == "2.6" ]]; then 27 conda install argparse 28 fi 31 - if [[ "$PYTHON_VERSION" == "2.6" ]]; then conda install argparse; fi 29 32 - python setup.py install 30 33 -
trunk/anuga_core/anuga/abstract_2d_finite_volumes/generic_domain.py
r9292 r9615 539 539 msg = 'Setting CFL > 2.0' 540 540 #warnings.warn(msg) 541 log.warn ()541 log.warning(msg) 542 542 543 543 assert cfl > 0.0 … … 1449 1449 triang = num.array(range(0,3*n)) 1450 1450 triang.shape = (n, 3) 1451 plt.triplot(gx, g , triang, 'b--')1451 plt.triplot(gx, gy, triang, 'b--') 1452 1452 1453 1453 # Save triangulation to location pointed by filename -
trunk/anuga_core/anuga/abstract_2d_finite_volumes/tests/test_util.py
r9562 r9615 1479 1479 def test_make_plots_from_csv_files(self): 1480 1480 1481 #if sys.platform == 'win32': #Windows 1482 try: 1483 import pylab 1484 except ImportError: 1485 #ANUGA don't need pylab to work so the system doesn't 1486 #rely on pylab being installed 1487 return 1488 1489 1490 current_dir=getcwd()+sep+'abstract_2d_finite_volumes' 1491 temp_dir = tempfile.mkdtemp('','figures') 1492 # print 'temp_dir',temp_dir 1493 fileName = temp_dir+sep+'time_series_3.csv' 1494 file = open(fileName,"w") 1495 file.write("time,stage,speed,momentum,elevation\n\ 1481 # #if sys.platform == 'win32': #Windows 1482 # try: 1483 # import pylab 1484 # except ImportError: 1485 # #ANUGA don't need pylab to work so the system doesn't 1486 # #rely on pylab being installed 1487 # return 1488 1489 try: 1490 import matplotlib 1491 matplotlib.use('Agg') 1492 import matplotlib.pyplot as plt 1493 except: 1494 #print "Couldn't import module from matplotlib, probably you need to update matplotlib" 1495 return 1496 1497 1498 current_dir=getcwd()+sep+'abstract_2d_finite_volumes' 1499 temp_dir = tempfile.mkdtemp('','tmp_figures') 1500 # print 'temp_dir',temp_dir 1501 fileName = temp_dir+sep+'time_series_3.csv' 1502 fid = open(fileName,"w") 1503 fid.write("time,stage,speed,momentum,elevation\n\ 1496 1504 1.0, 0, 0, 0, 10 \n\ 1497 1505 2.0, 5, 2, 4, 10 \n\ 1498 1506 3.0, 3, 3, 5, 10 \n") 1499 file.close()1500 1501 1502 file1 = open(fileName1,"w")1503 file1.write("time,stage,speed,momentum,elevation\n\1507 fid.close() 1508 1509 fileName1 = temp_dir+sep+'time_series_4.csv' 1510 fid1 = open(fileName1,"w") 1511 fid1.write("time,stage,speed,momentum,elevation\n\ 1504 1512 1.0, 0, 0, 0, 5 \n\ 1505 1513 2.0, -5, -2, -4, 5 \n\ 1506 1514 3.0, -4, -3, -5, 5 \n") 1507 file1.close()1508 1509 1510 file2 = open(fileName2,"w")1511 file2.write("time,stage,speed,momentum,elevation\n\1515 fid1.close() 1516 1517 fileName2 = temp_dir+sep+'time_series_5.csv' 1518 fid2 = open(fileName2,"w") 1519 fid2.write("time,stage,speed,momentum,elevation\n\ 1512 1520 1.0, 0, 0, 0, 7 \n\ 1513 1521 2.0, 4, -0.45, 57, 7 \n\ 1514 1522 3.0, 6, -0.5, 56, 7 \n") 1515 file2.close()1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1523 fid2.close() 1524 1525 dir, name=os.path.split(fileName) 1526 csv2timeseries_graphs(directories_dic={dir:['gauge', 0, 0]}, 1527 output_dir=temp_dir, 1528 base_name='time_series_', 1529 plot_numbers=['3-5'], 1530 quantities=['speed','stage','momentum'], 1531 assess_all_csv_files=True, 1532 extra_plot_name='test') 1533 1534 #print dir+sep+name[:-4]+'_stage_test.png' 1535 assert(access(dir+sep+name[:-4]+'_stage_test.png',F_OK)==True) 1536 assert(access(dir+sep+name[:-4]+'_speed_test.png',F_OK)==True) 1537 assert(access(dir+sep+name[:-4]+'_momentum_test.png',F_OK)==True) 1538 1539 dir1, name1=os.path.split(fileName1) 1540 assert(access(dir+sep+name1[:-4]+'_stage_test.png',F_OK)==True) 1541 assert(access(dir+sep+name1[:-4]+'_speed_test.png',F_OK)==True) 1542 assert(access(dir+sep+name1[:-4]+'_momentum_test.png',F_OK)==True) 1543 1544 1545 dir2, name2=os.path.split(fileName2) 1546 assert(access(dir+sep+name2[:-4]+'_stage_test.png',F_OK)==True) 1547 assert(access(dir+sep+name2[:-4]+'_speed_test.png',F_OK)==True) 1548 assert(access(dir+sep+name2[:-4]+'_momentum_test.png',F_OK)==True) 1549 1550 del_dir(temp_dir) 1543 1551 1544 1552 -
trunk/anuga_core/anuga/abstract_2d_finite_volumes/util.py
r8718 r9615 441 441 """ 442 442 443 try: 444 import pylab 445 except ImportError: 446 msg='csv2timeseries_graphs needs pylab to be installed correctly' 447 raise Exception(msg) 448 #ANUGA don't need pylab to work so the system doesn't 449 #rely on pylab being installed 443 # try: 444 # import pylab 445 # except ImportError: 446 # msg='csv2timeseries_graphs needs pylab to be installed correctly' 447 # raise Exception(msg) 448 # #ANUGA don't need pylab to work so the system doesn't 449 # #rely on pylab being installed 450 # return 451 452 try: 453 import matplotlib 454 matplotlib.use('Agg') 455 import matplotlib.pyplot as pylab 456 except: 457 #print "Couldn't import module from matplotlib, probably you need to update matplotlib" 450 458 return 451 459 … … 544 552 #add tide to stage if provided 545 553 if quantity == 'stage': 546 554 quantity_value[quantity] = num.array(quantity_value[quantity], 547 555 num.float) + directory_add_tide 548 556 -
trunk/anuga_core/anuga/geometry/polygon.py
r9214 r9615 724 724 725 725 726 from matplotlib.pyplot import hold, plot, savefig, xlabel, \ 726 727 try: 728 import matplotlib 729 matplotlib.use('Agg') 730 from matplotlib.pyplot import hold, plot, savefig, xlabel, \ 727 731 ylabel, title, close, title, fill 732 except: 733 return 728 734 729 735 assert type(polygons_points) == list, \ … … 780 786 #ioff() 781 787 hold(False) 788 782 789 close('all') 783 790
Note: See TracChangeset
for help on using the changeset viewer.