source: sasview/fit.py @ f6f3fb4

ticket-1094-headless
Last change on this file since f6f3fb4 was f6f3fb4, checked in by Paul Kienzle <pkienzle@…>, 6 years ago

add ability to run bumps fit from saved project without the sasview gui

  • Property mode set to 100755
File size: 1.0 KB
Line 
1#!/usr/bin/env python
2"""
3Bumps model file for running saved sasview fits.
4
5Fit configuration (including fitted variables and ranges) is set up in the
6Sasview GUI and saved as a .svs or .fitv file.  These can then be run
7directly from bumps using::
8
9    path/to/sasview/fit.py path/to/save.svs [--bumps_option ...]
10
11Alternatively, if sasview is installed on your python path, use::
12
13    python -m sas.sascalc.fit.fitstate path/to/save.svs [--bumps_option ...]
14
15In unix/mac you can create a file on your shell path (e.g., ~/bin/sasbumps)
16containing::
17
18    #!/usr/bin/env python
19    from sas.sascalc.fit.fitstate import bumps_cli
20    bumps_cli()
21
22set it as executable with::
23
24    chmod a+x ~/bin/sasbumps
25
26and use::
27
28    sasbumps path/to/save.svs [--bumps_option ...]
29"""
30
31# ============ Set up python environment ==============
32import sys
33import os
34sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
35from run import prepare
36del sys.path[0]
37prepare(rebuild=False)
38
39# =========== Run BUMPS ===============
40from sas.sascalc.fit.fitstate import bumps_cli
41bumps_cli()
Note: See TracBrowser for help on using the repository browser.