Changeset 6548
- Timestamp:
- Mar 18, 2009, 4:59:03 PM (16 years ago)
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/fit_interpolate/fit.py
r6545 r6548 474 474 alpha=DEFAULT_ALPHA, 475 475 verbose=False, 476 acceptable_overshoot=1.01,477 # FIXME: Move to config - this value is assumed in caching test478 # FIXME(Ole): Just realised that this was never implemented (29 Jan 2009). I suggest removing it altogether.479 476 mesh_origin=None, 480 477 data_origin=None, … … 493 490 'alpha': alpha, 494 491 'verbose': verbose, 495 'acceptable_overshoot': acceptable_overshoot,496 492 'mesh_origin': mesh_origin, 497 493 'data_origin': data_origin, … … 549 545 alpha=DEFAULT_ALPHA, 550 546 verbose=False, 551 acceptable_overshoot=1.01,552 547 mesh_origin=None, 553 548 data_origin=None, … … 575 570 alpha: Smoothing parameter. 576 571 577 acceptable overshoot: NOT IMPLEMENTED578 controls the allowed factor by which579 fitted values580 may exceed the value of input data. The lower limit is defined581 as min(z) - acceptable_overshoot*delta z and upper limit582 as max(z) + acceptable_overshoot*delta z583 584 572 585 573 mesh_origin: A geo_reference object or 3-tuples consisting of -
anuga_validation/automated_validation_tests/okushiri_tank_validation/test_caching_of_set_quantity.py
r6547 r6548 1 """This script tests that caching works for set_quantity using point data from a file. 1 """This script tests that caching works for set_quantity using point 2 data from a file. 2 3 First cache is cleared, then set_quantity is run twice checking that 3 4 fitting is evaluated only first time and that the result from cache on the … … 6 7 This script depends on Benchmark_2.msh and Benchmark_2_Bathymetry.pts 7 8 """ 8 # FIXME(Ole): This needs to become a unit test - in automated validation tests under Okushiri.9 10 # FIXME(Ole): This won't work until ticket:314 has been fixed.11 9 12 10 # Module imports … … 18 16 import time 19 17 20 internal_verbose = True # Verbos e used in set_quantity and passed into fit_to_mesh18 internal_verbose = True # Verbosity used within this function 21 19 22 20 filename=project.bathymetry_filename … … 27 25 # Create Domain from mesh 28 26 #------------------------- 29 domain = cache(Domain, (project.mesh_filename, {'verbose': True}), verbose=False) 27 domain = cache(Domain, 28 (project.mesh_filename, 29 {'verbose': True}), 30 verbose=False) 30 31 31 32 # Clear caching of underlying function … … 37 38 'alpha': alpha, 38 39 'verbose': internal_verbose, 39 'acceptable_overshoot': 1.01, # This is the default value in _fit_to_mesh - actually, not implemented. Remove!40 40 'mesh_origin': None, 41 41 'data_origin': None, … … 62 62 63 63 64 65 64 #------------------------- 66 65 # Initial Conditions 67 66 #------------------------- 68 #print 'Set elevation and cache'69 67 t0 = time.time() 70 68 domain.set_quantity('elevation', … … 84 82 dependencies=[filename], 85 83 test=True) 84 86 85 assert flag is not None 87 res = domain.get_quantity('elevation').get_values() 86 res = domain.get_quantity('elevation').get_values() 88 87 assert num.allclose(res, ref) 89 88 90 89 # Now check this using the high level call 91 92 90 print 'Try to read in via cache' 93 91 t0 = time.time() … … 99 97 cache_time = time.time()-t0 100 98 101 res = domain.get_quantity('elevation').get_values() 99 res = domain.get_quantity('elevation').get_values() 102 100 assert num.allclose(res, ref) 103 101 104 102 print 'cache_time', cache_time 105 103 print 'compute_time', compute_time 106 assert cache_time < compute_time/10 104 105 msg = 'Caching did not speed things up as expected' 106 assert cache_time < compute_time/10, msg -
anuga_validation/okushiri_2005/test_caching_of_set_quantity.py
r6237 r6548 1 """This script tests that caching works for set_quantity using point data from a file. 1 """This script tests that caching works for set_quantity using point 2 data from a file. 2 3 First cache is cleared, then set_quantity is run twice checking that 3 4 fitting is evaluated only first time and that the result from cache on the … … 6 7 This script depends on Benchmark_2.msh and Benchmark_2_Bathymetry.pts 7 8 """ 8 # FIXME(Ole): This needs to become a unit test - in automated validation tests under Okushiri.9 9 10 # FIXME(Ole): This won't work until ticket:314 has been fixed. 10 # FIXME(Ole): This script is obsolete and has been moved into the 11 # automatic validation unit test suite. 11 12 12 13 # Module imports … … 18 19 import time 19 20 20 internal_verbose = True # Verbos e used in set_quantity and passed into fit_to_mesh21 internal_verbose = True # Verbosity used within this function 21 22 22 23 filename=project.bathymetry_filename
Note: See TracChangeset
for help on using the changeset viewer.