1 | """ |
---|
2 | sasmodels |
---|
3 | ========= |
---|
4 | |
---|
5 | **sasmodels** is a package containing models for small angle neutron and xray |
---|
6 | scattering. Models supported are the one dimensional circular average and |
---|
7 | two dimensional oriented patterns. As well as the form factor calculations |
---|
8 | for the individual shapes **sasmodels** also provides automatic shape |
---|
9 | polydispersity, angular dispersion and resolution convolution. SESANS |
---|
10 | patterns can be computed for any model. |
---|
11 | |
---|
12 | Models can be written in python or in C. C models can run on the GPU if |
---|
13 | OpenCL drivers are available. See :mod:`generate` for details on |
---|
14 | defining new models. |
---|
15 | """ |
---|
16 | __version__ = "0.99" |
---|
17 | |
---|
18 | def 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 | def _expand_patterns(path, patterns): |
---|
31 | target_path = joinpath(EXTERNAL_DIR, *path) |
---|
32 | source_path = joinpath(DATA_PATH, *path) |
---|
33 | files = [] |
---|
34 | for p in patterns: |
---|
35 | files.extend(glob.glob(joinpath(source_path, p))) |
---|
36 | return target_path, files |
---|
37 | |
---|
38 | # Place the source for the model tree in the distribution. Minimally we |
---|
39 | # need the c and cl files for running on OpenCL. Need the py files so |
---|
40 | # users can easily copy existing models. Need the img files so that we |
---|
41 | # can build model docs on the fly, including images. |
---|
42 | return_list = [ |
---|
43 | _expand_patterns([], ['*.c', '*.cl']), |
---|
44 | _expand_patterns(['models'], ['*.py', '*.c']), |
---|
45 | _expand_patterns(['models', 'lib'], ['*.c']), |
---|
46 | _expand_patterns(['models', 'img'], ['*.*']), |
---|
47 | ] |
---|
48 | return return_list |
---|