Changeset 1392831 in sasmodels
- Timestamp:
- Aug 24, 2016 10:10:25 PM (8 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:
- 948db69, 3a45c2c
- Parents:
- 3bcb88c (diff), 0dc34c3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- sasmodels
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/generate.py
r7722b4a r0dc34c3 316 316 317 317 318 def timestamp(model_info):318 def dll_timestamp(model_info): 319 319 # type: (ModelInfo) -> int 320 320 """ 321 321 Return a timestamp for the model corresponding to the most recently 322 322 changed file or dependency. 323 """ 324 # TODO: fails DRY; templates appear two places. 325 model_templates = [joinpath(DATA_PATH, filename) 326 for filename in ('kernel_header.c', 'kernel_iq.c')] 327 source_files = (model_sources(model_info) 328 + model_templates 329 + [model_info.filename]) 330 # Note: file may not exist when it is a standard model from library.zip 331 times = [getmtime(f) for f in source_files if exists(f)] 332 newest = max(times) if times else 0 333 return newest 334 335 def ocl_timestamp(model_info): 336 # type: (ModelInfo) -> int 337 """ 338 Return a timestamp for the model corresponding to the most recently 339 changed file or dependency. 323 340 324 341 Note that this does not look at the time stamps for the OpenCL header 325 342 information since that need not trigger a recompile of the DLL. 326 343 """ 344 # TODO: fails DRY; templates appear two places. 345 model_templates = [joinpath(DATA_PATH, filename) 346 for filename in ('kernel_header.c', 'kernel_iq.cl')] 327 347 source_files = (model_sources(model_info) 328 + model_templates ()348 + model_templates 329 349 + [model_info.filename]) 330 newest = max(getmtime(f) for f in source_files) 350 # Note: file may not exist when it is a standard model from library.zip 351 times = [getmtime(f) for f in source_files if exists(f)] 352 newest = max(times) if times else 0 331 353 return newest 332 333 334 def model_templates():335 # type: () -> List[str]336 # TODO: fails DRY; templates appear two places.337 # should instead have model_info contain a list of paths338 # Note: kernel_iq.cl is not on this list because changing it need not339 # trigger a recompile of the dll.340 return [joinpath(DATA_PATH, filename)341 for filename in ('kernel_header.c', 'kernel_iq.c')]342 354 343 355 -
sasmodels/kernelcl.py
r300a2f7 r0dc34c3 397 397 if self.program is None: 398 398 compile_program = environment().compile_program 399 timestamp = generate. timestamp(self.info)399 timestamp = generate.ocl_timestamp(self.info) 400 400 self.program = compile_program( 401 401 self.info.name, -
sasmodels/kerneldll.py
rbde38b5 r0dc34c3 226 226 else: 227 227 dll_time = os.path.getmtime(dll) 228 newest_source = generate. timestamp(model_info)228 newest_source = generate.dll_timestamp(model_info) 229 229 need_recompile = dll_time < newest_source 230 230 if need_recompile: -
sasmodels/sasview_model.py
r300a2f7 r3bcb88c 454 454 """ 455 455 # TODO: fix test so that parameter order doesn't matter 456 ret = ['%s.%s' % (p.name, ext) 457 for p in self._model_info.parameters.user_parameters() 458 for ext in ('npts', 'nsigmas', 'width') 459 if p.polydisperse] 456 ret = ['%s.%s' % (p_name, ext) 457 for p_name in self.dispersion.keys() 458 for ext in ('npts', 'nsigmas', 'width')] 460 459 #print(ret) 461 460 return ret
Note: See TracChangeset
for help on using the changeset viewer.