Changeset c2c51a2 in sasmodels for sasmodels/__init__.py


Ignore:
Timestamp:
May 6, 2016 1:13:55 AM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
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:
306e354
Parents:
948b8c1
Message:

allow sasmodels to look in sasmodels-data for builtin model c source

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/__init__.py

    r37a7252 rc2c51a2  
    1414defining new models. 
    1515""" 
     16__version__ = "0.9" 
    1617 
    17 __version__ = "0.9" 
     18def data_files(): 
     19    """ 
     20    Return the data files to be installed with the package. 
     21 
     22    The format is a list of (directory, [files...]) pairs which can be 
     23    used directly in setup(...,data_files=...) for setup.py. 
     24    """ 
     25    from os.path import join as joinpath 
     26    from .generate import SIBLING_DIR, DATA_PATH 
     27    data_files = {} 
     28    def add_patterns(path, patterns): 
     29        data_files[joinpath(SIBLING_DIR, *path)] \ 
     30            = [joinpath(DATA_PATH, *(path+[p])) for p in patterns] 
     31    add_patterns([], ['*.c', '*.cl', 'convert.json']) 
     32    add_patterns(['models'], ['*.c']) 
     33    add_patterns(['models', 'lib'], ['*.c']) 
     34 
     35    return data_files 
     36 
Note: See TracChangeset for help on using the changeset viewer.