Changeset 6160


Ignore:
Timestamp:
Jan 14, 2009, 11:17:06 AM (10 years ago)
Author:
rwilson
Message:

Change Numeric imports to general form - ready to change to NumPy?.

Location:
anuga_validation/automated_validation_tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • anuga_validation/automated_validation_tests/okushiri_tank_validation/compare_timeseries_with_measures.py

    r5826 r6160  
    66"""
    77
    8 from Numeric import allclose, argmin, argmax
     8import Numeric as num
    99from Scientific.IO.NetCDF import NetCDFFile
    1010
     
    113113assert reference_time[0] == 0.0
    114114assert reference_time[-1] == finaltime
    115 assert allclose(reference_time, input_time)
     115assert num.allclose(reference_time, input_time)
    116116
    117117for key in gauge_names:
     
    152152    #                            rtol=rtol, atol=atol)
    153153    if plotting is False:
    154         assert allclose(reference_value, computed_value,
    155                         rtol=rtol, atol=atol), msg
     154        assert num.allclose(reference_value, computed_value,
     155                            rtol=rtol, atol=atol), msg
    156156   
    157157
     
    198198    # Locations of extrema
    199199    #i0 = argmax(observed_timeseries)
    200     i1 = argmax(model)
     200    i1 = num.argmax(model)
    201201    res = reference_time[i1]
    202202    report_difference('Location of maximum', res, expected_argmax[name], rtol, atol)   
     
    205205    if not name in ['ch7', 'ch9']:
    206206        # Minima of ch7 and ch9 are very flat and hard to pinpoint
    207         i1 = argmin(model)
     207        i1 = num.argmin(model)
    208208        res = reference_time[i1]
    209209        report_difference('Location of minimum', res, expected_argmin[name],
  • anuga_validation/automated_validation_tests/okushiri_tank_validation/create_okushiri.py

    r4783 r6160  
    33
    44
    5 from Numeric import array, zeros, Float, allclose
     5import Numeric as num
    66
    77from anuga.pmesh.mesh import *
     
    9696
    9797    from Scientific.IO.NetCDF import NetCDFFile
    98     from Numeric import array
    99 
    10098
    10199    print 'Creating', filename
     
    113111
    114112    N = len(lines)
    115     T = zeros(N, Float)  #Time
    116     Q = zeros(N, Float)  #Values
     113    T = num.zeros(N, num.Float)  #Time
     114    Q = num.zeros(N, num.Float)  #Values
    117115
    118116    for i, line in enumerate(lines):
     
    130128    fid.starttime = 0.0
    131129    fid.createDimension('number_of_timesteps', len(T))
    132     fid.createVariable('time', Float, ('number_of_timesteps',))
     130    fid.createVariable('time', num.Float, ('number_of_timesteps',))
    133131    fid.variables['time'][:] = T
    134132
    135     fid.createVariable('stage', Float, ('number_of_timesteps',))
     133    fid.createVariable('stage', num.Float, ('number_of_timesteps',))
    136134    fid.variables['stage'][:] = Q[:]
    137135
    138     fid.createVariable('xmomentum', Float, ('number_of_timesteps',))
     136    fid.createVariable('xmomentum', num.Float, ('number_of_timesteps',))
    139137    fid.variables['xmomentum'][:] = 0.0
    140138
    141     fid.createVariable('ymomentum', Float, ('number_of_timesteps',))
     139    fid.createVariable('ymomentum', num.Float, ('number_of_timesteps',))
    142140    fid.variables['ymomentum'][:] = 0.0
    143141
  • anuga_validation/automated_validation_tests/urs_mux_files_validation/run_Bf.py

    r5107 r6160  
    2020# Related major packages
    2121from anuga.shallow_water import Domain,Dirichlet_boundary,File_boundary,Transmissive_boundary, Field_boundary
    22 from Numeric import allclose, array
     22import Numeric as num
    2323from anuga.pmesh.mesh_interface import create_mesh_from_regions
    2424from anuga.abstract_2d_finite_volumes.util import start_screen_catcher, copy_code_files, sww2timeseries, get_data_from_file
     
    243243# Compares the two time series
    244244#----------------------------------------------------------------------------
    245 assert allclose (b_sample, e_sample, 0.5, 0.5)
     245assert num.allclose (b_sample, e_sample, 0.5, 0.5)
    246246
    247247
Note: See TracChangeset for help on using the changeset viewer.