source: sasmodels/sasmodels/__init__.py @ a5da1f2

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since a5da1f2 was a5da1f2, checked in by Paul Kienzle <pkienzle@…>, 8 years ago

fix path to models in frozen version of application

  • Property mode set to 100644
File size: 1.5 KB
Line 
1"""
2sasmodels
3=========
4
5**sasmodels** is a package containing models for small angle neutron and xray
6scattering.  Models supported are the one dimensional circular average and
7two dimensional oriented patterns.  As well as the form factor calculations
8for the individual shapes **sasmodels** also provides automatic shape
9polydispersity, angular dispersion and resolution convolution.  SESANS
10patterns can be computed for any model.
11
12Models can be written in python or in C.  C models can run on the GPU if
13OpenCL drivers are available.  See :mod:`generate` for details on
14defining new models.
15"""
16__version__ = "0.9"
17
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    import glob
27
28    from .generate import EXTERNAL_DIR, DATA_PATH
29
30    data_files = {}
31    def add_patterns(path, patterns):
32        data_files[joinpath(EXTERNAL_DIR, *path)] \
33            = [joinpath(DATA_PATH, *(path+[p])) for p in patterns]
34    add_patterns([], ['*.c', '*.cl', 'convert.json'])
35    add_patterns(['models'], ['*.c'])
36    add_patterns(['models', 'lib'], ['*.c'])
37
38    # Fish out full paths for all files.
39    return_list=[]
40    for path, patterns in data_files.items():
41        files_data=[]
42        for pattern in patterns:
43            files_data.extend(glob.glob(pattern))
44        return_list.append([path, files_data])
45    return return_list
46
47
Note: See TracBrowser for help on using the repository browser.