Package park

Source Code for Package park

 1  # This program is public domain 
 2  """ 
 3  PARK fitting service. 
 4   
 5  The PARK fitting service is a set of python packages to support 
 6  fitting in datasets.  Using common python infrastructure such 
 7  as scipy optimizers, numpy arrays, and matplotlib plotting, park 
 8  allows you to define models, associate them with datasets and 
 9  simultaneously fit them.  Park provides a simple job queue to 
10  manage multiple fits using separate processes or running across 
11  the network on separate machines. 
12   
13  Usage 
14  ===== 
15   
16  To get started with park, you will need to first define the 
17  models that you are using.  These can be very basic models, 
18  listing all possible fitting parameters.  When setting up the 
19  fit later, you will be able to combine models, using 
20  parameter expressions to relate the values in one model with 
21  those in another.  See `park.model` for details. 
22   
23  Once your models are constructed you can use them in a fit. 
24  See `park.fit` for details. 
25   
26  Important classes and functions: 
27  `park.model.Model`, `park.parameter.ParameterSet`, `park.fit.Fit` 
28  """ 
29   
30  import park.configure 
31   
32  # Symbols for constructing fit models 
33  from park.modelling.model import Model 
34  from park.modelling.data import Data1D 
35  from park.modelling.assembly import Assembly, Fitness 
36  from park.modelling.parameter import Parameter, ParameterSet 
37  from park.fitting.fit import fit 
38   
39 -def local_service():
40 import park.core.server 41 return park.core.server.local_service
42
43 -def remote_service(URL):
44 import park.core.server 45 return park.core.server.remote_service(URL)
46
47 -def fetch_url(url=None, **kw):
48 """ 49 Request a file based on URL. 50 """ 51 from park.core.serviceproxy import Proxy 52 from park.core.datastore import FetchRequest 53 job = Proxy(FetchRequest.service,**kw) 54 job.submit(FetchRequest(url=url)) 55 return job
56 57 # TODO: move installation documentation to a separate file 58 _ = """ 59 Installation 60 ============ 61 62 The latest version of Park is available from 63 http://www.reflectometry.org/danse/park. 64 65 66 Currently this is supplied as source from a zip file. You can 67 also retrieve the latest version from svn:: 68 69 svn co svn://danse.us/park/branches/park-1.3 70 71 If you are installing from source, you will need a python 72 environment with numpy and scipy. For the GUI version, you 73 will also need matplotlib and wx. 74 75 You will need a C compiler to build the resolution convolution 76 function. On Windows this may require installing MinGW and 77 adding distutils.cfg to your distutils directory:: 78 79 [build] 80 compiler = mingw 81 82 Once you have the required supporting packages, use the following 83 to build and install:: 84 85 python setup.py install 86 """ 87