pymvpa2-exec - Online in the Cloud

This is the command pymvpa2-exec that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


pymvpa2-exec - evaluate arbitrary Python expressions for tests and assertions

SYNOPSIS


pymvpa2 exec [--version] [-h] [-i [DATASET [DATASET ...]]] -e EXPR [-s NAME [NAME ...]]
[-o OUTPUT] [--hdf5-compression TYPE]

DESCRIPTION


Execute arbitrary Python expressions (on datasets)

This command can be used to execute arbitrary Python scripts while avoiding unnecessary
boilerplate code to load datasets and store results. This command is also useful for
testing functionality and results via the commandline interface and for asserting
arbitrary conditions in scripts.

First, optional dataset(s) are loaded from one or more sources. Afterwards any number of
given expressions (see --exec) are executed. An expression can be given as an argument on
the command line, read from a file, or from STDIN. The return value of any given
expression is ignored (not evaluated anyhow), only exceptions are treated as errors and
cause the command to exit with a non-zero return value. To implement tests and assertions
it is best to utilize a Python unittest framework such as 'nose'.

In the namespace in which all expressions are evaluated the NumPy module is available via
the alias 'np', and the nose.tools under the alias 'nt' (if installed). Any loaded
datasets are available as a list named ``dss``. The first dataset in that list (if any) is
available under the name ``ds``.

OPTIONS


--version
show program's version and license information and exit

-h, --help, --help-np
show this help message and exit. --help-np forcefully disables the use of a pager
for displaying the help.

-i [DATASET [DATASET ...]], --input [DATASET [DATASET ...]]
path(s) to one or more PyMVPA dataset files. All datasets will be merged into a
single dataset (vstack'ed) in order of specification. In some cases this option may
need to be specified more than once if multiple, but separate, input datasets are
required.

-e EXPR, --exec EXPR
Python expression, or filename of a Python script, or '-' to read expressions from
STDIN.

Output options:
-s NAME [NAME ...], --store NAME [NAME ...]
One or more names of variables or objects to extract from the local name space
after all expressions have been executed. They will be stored in a dictionary in
HDF5 format (requires --output).

-o OUTPUT, --output OUTPUT
output filename ('.hdf5' extension is added automatically if necessary). NOTE: The
output format is suitable for data exchange between PyMVPA commands, but is not
recommended for long-term storage or exchange as its specific content may vary
depending on the actual software environment. For long-term storage consider
conversion into other data formats (see 'dump' command).

--hdf5-compression TYPE
compression type for HDF5 storage. Available values depend on the specific HDF5
installation. Typical values are: 'gzip', 'lzf', 'szip', or integers from 1 to 9
indicating gzip compression levels.

EXAMPLES


Assert some condition

$ pymvpa2 exec -e 'assert(4==4)'

Check for the presence of a particular sample attribute in a dataset

$ pymvpa2 exec -e 'dss[0].sa.subj3' -i mydata.hdf5

Extract and store results

$ pymvpa2 exec -e 'a=5' -e 'print a' --store a -o mylittlea.hdf5

Use pymvpa2-exec online using onworks.net services



Latest Linux & Windows online programs