Welcome, Guest! Log In | Create Account

Main Page

From pyslice

Jump to: navigation, search

Contents

Abstract

Pyslice is a specialized templating system that replaces variables in a template data set with numbers taken from all combinations of a grouped series of numbers. It creates a dataset from input template files for each combination of variables in the series.

The main function of Pyslice is to provide utility functions for parametric modeling. Parametric modeling is a process of varying many inputs to a model. A drawback to parametric modeling is that there are usually hundreds to thousands of data sets to prepare and a corresponding number of model runs. Pyslice will create the model data sets and manage the model runs, or place the model runs in a queue managed by other software. Pyslice is also useful in establishing the sensitivity of a model to changing parameters.

I called the program Pyslice for the obvious double meaning and that the program slices up the input domain of numbers to a simulation.

Documentation

UsersManual

DevelopersGuide

Home Page: http://pyslice.sourceforge.net

Project Page: http://sourceforge.net/projects/pyslice

Requirements

Python: Python 2.4 or higher

Model

Any model executable that can be specified with an absolute path or is inside a directory in PATH. No changes to the model code are required if it draws inputs files from the current working directory.

Installation

There are three ways to install PySlice. I have included an example for each method, but please read through the example to make sure it does what you want.

1) Standard Python distutils install:

##
# If you have wget...
wget http://prdownloads.sourceforge.net/pyslice/pyslice-1.6.4.tar.gz
# Or download pyslice-1.6.4.ebuild
cp pyslice-1.6.4.tar.gz myworkdir
cd myworkdir
gzip -cd pyslice-1.6.4.tar.gz | tar xvf -
cd pyslice-1.6.4

 # At this point you can try pyslice before installing.
 # If you know you want to install you can skip this section
 cd example
 # To fill the 'example/output' directory with filled templates from the 'example/input_template' directory...
 # On Linux
 ./go_linux
 # On Windows
 ./go_windows.bat 
 cd ..

# To install...
python setup.py build
python setup.py install  #possibly as root
##

2) With easy_install available from PEAK. This looks like it might be the easiest, but I have had problems with easy_install before and for several reasons don't really like it. I changed PySlice to accommodate, but use at your own discretion.

##
easy_install Pyslice
##

3) If you use the Gentoo Linux Distribution you can download the pyslice ebuild from pyslice-1.6.4.ebuild. You need to know how to handle overlay ebuilds, but if you have the defaults for overlay ebuilds in /etc/make.conf:

##
mkdir -p /usr/local/portage/sys-cluster/pyslice
wget -P /usr/local/portage/sys-cluster/pyslice http://prdownloads.sourceforge.net/pyslice/pyslice-1.6.4.tar.gz
ebuild /usr/local/portage/sys-cluster/pyslice/pyslice-1.6.4.ebuild digest
emerge pyslice
##

Example

Look in UsersManual for instructions on how to run the included example.

Similar Projects

Some templating systems, which I am not going to list here, might be able to be pressed into service, but it was a difficult enough prospect that I wrote Pyslice. The initial push to write Pyslice was my inability to get the Drone software installed and working. Plus Drone was way over what I really needed. Here are links to similar projects to Pyslice:

PySPG: Pyslice uses PySPG as a library to generate values.
SweepOver:
SweepOver seems to have a GUI.
Drone Util: part of the Drone system.
Drone: I think a Drone client?
Droned: Drone server.

Contributions

Development

Any help is appreciated. If you want you could send a patch file to me, or if you would like to make a bunch of changes I can assign you developer privledges to the source code repository. Just contact me at timcera at earthlink dot net.

Changes

1.6.4: 2009-03-10

   - Windows fixes from Kevin Northover (THANKS!)
    + Removed close_fds from the subprocess command - not available on Windows
    + Created a example/go_windows.bat
    + Changed the example/pyslice.ini to have a generic program to run (dir)
   - Created a example/go_linux since couldn't figure out a single file that would run on both platforms.
   - Some stylistic changes moving from 'while...' to 'for ...' constructs where possible.

1.6.3: 2009-03-09

   - Added more error checking
   - Fixed pyslice.ini parsing bug introduced in 1.6.2
   - Fixed setup.py script

1.6.2: 2009-03-09

   - Changed string exceptions to class based exceptions
   - Added some error checking

1.6.1: 2007-03-22

   - Now should work with easy_install.

1.6: 2005-08-30

   - Moved to threads rather than 'os.fork/os.exec' which means that pyslice.py should be able to run on Windows, though not tested.  Eliminated a bunch of code required by the 'os.fork/os.exec' that should make pyslice.py easier to maintain.

1.5: 2005-06-06

   - Uses 'pyslice.ini' instead of 'pyslice.conf'.  This allows the use of .ini editors to easily map to the correct format.

1.4: 2005-05-30

   - Can pull variable values from statistical distributions in Python's 'random' package.
   - Uses os.path.walk to make considerable faster.
   - Minor code clean-up

1.3: 2004-12-16

   - Now depends on Python 2.x or better. Am now using the PySPG library (http://pyspg.sourceforge.net/) in order to develop the variable sets. Because of PySPG now have the capability of doing geometric and list based parameter generation.

1.1: 2001-07-10

   - Removed Python 2.x dependencies. Variables can now use floating point. Works correctly to just create data sets by setting max_processes = 0 in pyslice.conf. Changes to documentation.

1.0: 2001-07-10

   - Initial release.

Authors

Tim Cera (email: timcera@earthlink.net)

Claudio J. Tessone, [PySPG] library