Changeset 82923a6 in sasmodels
- Timestamp:
- Apr 18, 2016 8:31:11 AM (9 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 3a45c2c, f36c1b7
- Parents:
- 7835d462
- Location:
- sasmodels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/model_test.py
re78edc4 r82923a6 207 207 self.assertTrue(np.isfinite(actual_yi), 208 208 'invalid f(%s): %s' % (xi, actual_yi)) 209 elif np.isnan(yi): 210 self.assertTrue(np.isnan(actual_yi), 211 'f(%s): expected:%s; actual:%s' 212 % (xi, yi, actual_yi)) 209 213 else: 210 self.assertTrue(is_near(yi, actual_yi, 5), 214 # is_near does not work for infinite values, so also test 215 # for exact values. Note that this will not 216 self.assertTrue(yi==actual_yi or is_near(yi, actual_yi, 5), 211 217 'f(%s); expected:%s; actual:%s' 212 218 % (xi, yi, actual_yi)) -
sasmodels/models/porod.py
rec45c4f r82923a6 26 26 """ 27 27 28 from numpy import sqrt, power 28 from numpy import sqrt, power, inf, errstate 29 29 30 30 name = "porod" … … 42 42 @param q: Input q-value 43 43 """ 44 return 1.0/power(q, 4) 44 with errstate(divide='ignore'): 45 return power(q, -4) 45 46 46 47 Iq.vectorized = True # Iq accepts an array of q values … … 58 59 demo = dict(scale=1.5, background=0.5) 59 60 60 tests = [[{'scale': 0.00001, 'background':0.01}, 0.04, 3.916250]] 61 tests = [ 62 [{'scale': 0.00001, 'background':0.01}, 0.04, 3.916250], 63 [{}, 0.0, inf], 64 ]
Note: See TracChangeset
for help on using the changeset viewer.